From: edward Date: Wed, 13 Jan 2016 04:00:11 +0000 (+0800) Subject: Roo/bootstrap/Img.js X-Git-Url: http://git.roojs.org/?a=commitdiff_plain;h=8a925ff62565ac51df318a24418c7f34bf1b3493;p=roojs1 Roo/bootstrap/Img.js roojs-bootstrap.js roojs-bootstrap-debug.js --- diff --git a/Roo/bootstrap/Img.js b/Roo/bootstrap/Img.js index 72b436c740..bf95b9edbd 100644 --- a/Roo/bootstrap/Img.js +++ b/Roo/bootstrap/Img.js @@ -82,7 +82,7 @@ Roo.extend(Roo.bootstrap.Img, Roo.bootstrap.Component, { var s = ['xs', 'sm', 'md', 'lg']; - Roo.eac(ss.splice(ss.indexOf(size), 1), function(ss){ + Roo.eac(s.splice(s.indexOf(size), 1), function(ss){ img.cls += ' hidden-' + ss; }); diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 0c467ba709..4a512866b2 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -1392,7 +1392,7 @@ Roo.extend(Roo.bootstrap.Img, Roo.bootstrap.Component, { var s = ['xs', 'sm', 'md', 'lg']; - Roo.eac(ss.splice(ss.indexOf(size), 1), function(ss){ + Roo.eac(s.splice(s.indexOf(size), 1), function(ss){ img.cls += ' hidden-' + ss; }); diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 49a975678b..f319d5f45b 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -37,7 +37,7 @@ A.dom.innerHTML=v;},getTitle:function(){var A=this.titleEl();if(!A){return '';}r t.dom.innerHTML=v;}}); //Roo/bootstrap/Img.js Roo.bootstrap.Img=function(A){Roo.bootstrap.Img.superclass.constructor.call(this,A);this.addEvents({"click":true});};Roo.extend(Roo.bootstrap.Img,Roo.bootstrap.Component,{imgResponsive:true,border:'',src:'',href:false,target:false,xsUrl:'',smUrl:'',mdUrl:'',lgUrl:'',getAutoCreate:function(){if(this.src||(!this.xsUrl&&!this.smUrl&&!this.mdUrl&&!this.lgUrl)){return this.createSingleImg();}var A={tag:'div',cls:'roo-image-responsive-group',cn:[]};var _this=this;Roo.each(['xs','sm','md','lg'],function(B){if(!_this[B+'Url']){return;}var C={tag:'img',cls:(_this.imgResponsive)?'img-responsive':'',html:_this.html||A.html,src:_this[B+'Url']} -C.cls+=' roo-image-responsive-'+B;var s=['xs','sm','md','lg'];Roo.eac(ss.splice(ss.indexOf(B),1),function(ss){C.cls+=' hidden-'+ss;});if(['rounded','circle','thumbnail'].indexOf(_this.border)>-1){A.cls+=' img-'+_this.border;}if(_this.alt){A.alt=_this.alt;}if(_this.href){var a={tag:'a',href:_this.href,cn:[C]};if(this.target){a.target=_this.target;}} +C.cls+=' roo-image-responsive-'+B;var s=['xs','sm','md','lg'];Roo.eac(s.splice(s.indexOf(B),1),function(ss){C.cls+=' hidden-'+ss;});if(['rounded','circle','thumbnail'].indexOf(_this.border)>-1){A.cls+=' img-'+_this.border;}if(_this.alt){A.alt=_this.alt;}if(_this.href){var a={tag:'a',href:_this.href,cn:[C]};if(this.target){a.target=_this.target;}} A.cn.push((_this.href)?a:C);});return A;},createSingleImg:function(){var A={tag:'img',cls:(this.imgResponsive)?'img-responsive':'',html:null} A.html=this.html||A.html;A.src=this.src||A.src;if(['rounded','circle','thumbnail'].indexOf(this.border)>-1){A.cls+=' img-'+this.border;}if(this.alt){A.alt=this.alt;}if(this.href){var a={tag:'a',href:this.href,cn:[A]};if(this.target){a.target=this.target;}}return (this.href)?a:A;},initEvents:function(){if(!this.href){this.el.on('click',this.onClick,this);}},onClick:function(e){Roo.log('img onclick');this.fireEvent('click',this,e);}}); //Roo/bootstrap/Link.js