// # Patch to fix #5043 to move this *after* the if/else clause in order for Backbone and similar frameworks to have improved control over event binding and data-options updating.
if(typeofmethod==='string'){
returnthis[method].call(this,options);
}
};
varsingle_image_loaded=function(image,callback){
functionloaded(){
callback(image[0]);
}
functionbindLoad(){
this.one('load',loaded);
if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){
varsrc=this.attr('src'),
param=src.match(/\?/)?'&':'?';
param+='random='+(newDate()).getTime();
this.attr('src',src+param);
}
}
if(!image.attr('src')){
loaded();
return;
}
if(image[0].complete||image[0].readyState===4){
loaded();
}else{
bindLoad.call(image);
}
};
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. Dual MIT/BSD license */
window.matchMedia||(window.matchMedia=function(){
"use strict";
// For browsers that support matchMedium api such as IE 9 and webkit