Roo/bootstrap/ComboBox.js
authorjohn <john@roojs.com>
Fri, 26 Jan 2018 07:46:51 +0000 (15:46 +0800)
committerjohn <john@roojs.com>
Fri, 26 Jan 2018 07:46:51 +0000 (15:46 +0800)
roojs-bootstrap.js
roojs-bootstrap-debug.js

Roo/bootstrap/ComboBox.js
roojs-bootstrap-debug.js
roojs-bootstrap.js

index 55fcc9e..a955f80 100644 (file)
@@ -650,7 +650,7 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
         Roo.log('------------store--------------');
         Roo.log(this.store);
         
-        this.store = Roo.factory(this.store, Roo.data);z
+        this.store = Roo.factory(this.store, Roo.data);
         this.store.parent = this;
         
         // if we are building from html. then this element is so complex, that we can not really
index 844514c..43a9e8f 100644 (file)
@@ -12982,6 +12982,9 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
             throw "can not find store for combo";
         }
         
+        Roo.log('------------store--------------');
+        Roo.log(this.store);
+        
         this.store = Roo.factory(this.store, Roo.data);
         this.store.parent = this;
         
@@ -28838,6 +28841,8 @@ Roo.extend(Roo.bootstrap.DocumentManager, Roo.bootstrap.Component,  {
             return file;
         }
         
+        var img_src = encodeURI(baseURL +'/Images/Thumb/' + this.thumbSize + '/' + file.id + '/' + file.filename);
+        
         var previewEl = this.managerEl.createChild({
             tag : 'div',
             cls : 'roo-document-manager-preview',
@@ -28846,7 +28851,7 @@ Roo.extend(Roo.bootstrap.DocumentManager, Roo.bootstrap.Component,  {
                     tag : 'div',
                     tooltip : file[this.toolTipName],
                     cls : 'roo-document-manager-thumb',
-                    html : '<img tooltip="' + file[this.toolTipName] + '" src="' + baseURL +'/Images/Thumb/' + this.thumbSize + '/' + file.id + '/' + encodeURI(file.filename) + '">'
+                    html : '<img tooltip="' + file[this.toolTipName] + '" src="' + img_src + '">'
                 },
                 {
                     tag : 'button',
index aca3b8f..e22bf9f 100644 (file)
@@ -510,11 +510,11 @@ A.cn=[{tag:'i',cls:'roo-required-indicator left-indicator text-danger fa fa-lg f
 }if(this.labellg>0){K.cls+=' col-lg-'+this.labellg;L.cls+=' col-lg-'+(12-this.labellg);}if(this.labelmd>0){K.cls+=' col-md-'+this.labelmd;L.cls+=' col-md-'+(12-this.labelmd);}if(this.labelsm>0){K.cls+=' col-sm-'+this.labelsm;L.cls+=' col-sm-'+(12-this.labelsm);
 }if(this.labelxs>0){K.cls+=' col-xs-'+this.labelxs;L.cls+=' col-xs-'+(12-this.labelxs);}}else if(this.fieldLabel.length){A.cn=[{tag:'i',cls:'roo-required-indicator left-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'},{tag:'label',html:this.fieldLabel}
 ,I];if(this.indicatorpos=='right'){A.cn=[{tag:'label',html:this.fieldLabel},{tag:'i',cls:'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',tooltip:'This field is required'},I];}}else{A=I}var M=this;['xs','sm','md','lg'].map(function(N){if(M[N]){A.cls+=' col-'+N+'-'+M[N];
-}});return A;},_initEventsCalled:false,initEvents:function(){if(this._initEventsCalled){return;}this._initEventsCalled=true;if(!this.store){throw "can not find store for combo";}this.store=Roo.factory(this.store,Roo.data);this.store.parent=this;if(Roo.XComponent.build_from_html){var e=this.el.dom,k=0;
-while(e){e=e.previousSibling;++k;}this.el.remove();this.el=false;this.rendered=false;this.render(this.parent().getChildContainer(true),k);}if(Roo.isIOS&&this.useNativeIOS){this.initIOSView();return;}if(Roo.isTouch&&this.mobileTouchView){this.initTouchView();
-return;}if(this.tickable){this.initTickableEvents();return;}Roo.bootstrap.ComboBox.superclass.initEvents.call(this);if(this.hiddenName){this.hiddenField=this.el.select('input.form-hidden-field',true).first();this.hiddenField.dom.value=this.hiddenValue!==undefined?this.hiddenValue:this.value!==undefined?this.value:'';
-this.el.dom.removeAttribute('name');this.hiddenField.dom.setAttribute('name',this.hiddenName);}var A='x-combo-list';var B=this;(function(){var lw=B.listWidth||Math.max(B.inputEl().getWidth(),B.minListWidth);B.list.setWidth(lw);}).defer(100);this.list.on('mouseover',this.onViewOver,this);
-this.list.on('mousemove',this.onViewMove,this);this.list.on('scroll',this.onViewScroll,this);if(!this.tpl){this.tpl='<li><a href="#">{'+this.displayField+'}</a></li>';}this.view=new Roo.View(this.list,this.tpl,{singleSelect:true,store:this.store,selectedClass:this.selectedClass}
+}});return A;},_initEventsCalled:false,initEvents:function(){if(this._initEventsCalled){return;}this._initEventsCalled=true;if(!this.store){throw "can not find store for combo";}Roo.log('------------store--------------');Roo.log(this.store);this.store=Roo.factory(this.store,Roo.data);
+this.store.parent=this;if(Roo.XComponent.build_from_html){var e=this.el.dom,k=0;while(e){e=e.previousSibling;++k;}this.el.remove();this.el=false;this.rendered=false;this.render(this.parent().getChildContainer(true),k);}if(Roo.isIOS&&this.useNativeIOS){this.initIOSView();
+return;}if(Roo.isTouch&&this.mobileTouchView){this.initTouchView();return;}if(this.tickable){this.initTickableEvents();return;}Roo.bootstrap.ComboBox.superclass.initEvents.call(this);if(this.hiddenName){this.hiddenField=this.el.select('input.form-hidden-field',true).first();
+this.hiddenField.dom.value=this.hiddenValue!==undefined?this.hiddenValue:this.value!==undefined?this.value:'';this.el.dom.removeAttribute('name');this.hiddenField.dom.setAttribute('name',this.hiddenName);}var A='x-combo-list';var B=this;(function(){var lw=B.listWidth||Math.max(B.inputEl().getWidth(),B.minListWidth);
+B.list.setWidth(lw);}).defer(100);this.list.on('mouseover',this.onViewOver,this);this.list.on('mousemove',this.onViewMove,this);this.list.on('scroll',this.onViewScroll,this);if(!this.tpl){this.tpl='<li><a href="#">{'+this.displayField+'}</a></li>';}this.view=new Roo.View(this.list,this.tpl,{singleSelect:true,store:this.store,selectedClass:this.selectedClass}
 );this.view.on('click',this.onViewClick,this);this.store.on('beforeload',this.onBeforeLoad,this);this.store.on('load',this.onLoad,this);this.store.on('loadexception',this.onLoadException,this);if(!this.editable){this.editable=true;this.setEditable(false);
 }this.keyNav=new Roo.KeyNav(this.inputEl(),{"up":function(e){this.inKeyMode=true;this.selectPrev();},"down":function(e){if(!this.isExpanded()){this.onTriggerClick();}else{this.inKeyMode=true;this.selectNext();}},"enter":function(e){this.collapse();if(this.fireEvent("specialkey",this,e)){this.onViewClick(false);
 }return true;},"esc":function(e){this.collapse();},"tab":function(e){this.collapse();if(this.fireEvent("specialkey",this,e)){this.onViewClick(false);}return true;},scope:this,doRelay:function(C,D,E){if(E=='down'||this.scope.isExpanded()){return Roo.KeyNav.prototype.doRelay.apply(this,arguments);
@@ -1223,9 +1223,9 @@ if(typeof(A.id)!='undefined'&&A.id*1>0){this.arrange();return;}A.xhr=this.xhr;th
 ]});this.xhr.open(this.method,this.url,true);var C={"Accept":"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};for(var D in C){var E=C[D];if(E){this.xhr.setRequestHeader(D,E);}}var F=this;this.xhr.onload=function(){F.xhrOnLoad(F.xhr);
 };this.xhr.onerror=function(){F.xhrOnError(F.xhr);};var G=new FormData();G.append('returnHTML','NO');if(B){G.append('crop',B);}G.append(this.paramName,A,A.name);var H={file:A,manually:false};if(this.fireEvent('prepare',this,G,H)!=false){if(H.manually){return;
 }this.xhr.send(G);return;};this.uploadCancel();},uploadCancel:function(){if(this.xhr){this.xhr.abort();}this.delegates=[];Roo.each(this.managerEl.select('.roo-document-manager-loading',true).elements,function(el){el.remove();},this);this.arrange();},renderPreview:function(A){if(typeof(A.target)!='undefined'&&A.target){return A;
-}var B=this.managerEl.createChild({tag:'div',cls:'roo-document-manager-preview',cn:[{tag:'div',tooltip:A[this.toolTipName],cls:'roo-document-manager-thumb',html:'<img tooltip="'+A[this.toolTipName]+'" src="'+baseURL+'/Images/Thumb/'+this.thumbSize+'/'+A.id+'/'+encodeURI(A.filename)+'">'}
-,{tag:'button',cls:'close',html:'<i class="fa fa-times-circle"></i>'}]});var C=B.select('button.close',true).first();C.on('click',this.onRemove,this,A);A.target=B;var D=B.select('img',true).first();var E=this;D.dom.addEventListener("load",function(){E.onPreviewLoad(A,D);
-});D.on('click',this.onClick,this,A);return A;},onPreviewLoad:function(A,B){if(typeof(A.target)=='undefined'||!A.target){return;}var C=B.dom.naturalWidth||B.dom.width;var D=B.dom.naturalHeight||B.dom.height;if(C>D){A.target.addClass('wide');return;}A.target.addClass('tall');
+}var B=encodeURI(baseURL+'/Images/Thumb/'+this.thumbSize+'/'+A.id+'/'+A.filename);var C=this.managerEl.createChild({tag:'div',cls:'roo-document-manager-preview',cn:[{tag:'div',tooltip:A[this.toolTipName],cls:'roo-document-manager-thumb',html:'<img tooltip="'+A[this.toolTipName]+'" src="'+B+'">'}
+,{tag:'button',cls:'close',html:'<i class="fa fa-times-circle"></i>'}]});var D=C.select('button.close',true).first();D.on('click',this.onRemove,this,A);A.target=C;var E=C.select('img',true).first();var F=this;E.dom.addEventListener("load",function(){F.onPreviewLoad(A,E);
+});E.on('click',this.onClick,this,A);return A;},onPreviewLoad:function(A,B){if(typeof(A.target)=='undefined'||!A.target){return;}var C=B.dom.naturalWidth||B.dom.width;var D=B.dom.naturalHeight||B.dom.height;if(C>D){A.target.addClass('wide');return;}A.target.addClass('tall');
 return;},uploadFromSource:function(A,B){this.xhr=new XMLHttpRequest();this.managerEl.createChild({tag:'div',cls:'roo-document-manager-loading',cn:[{tag:'div',tooltip:A.name,cls:'roo-document-manager-thumb',html:'<i class="fa fa-circle-o-notch fa-spin"></i>'}
 ]});this.xhr.open(this.method,this.url,true);var C={"Accept":"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};for(var D in C){var E=C[D];if(E){this.xhr.setRequestHeader(D,E);}}var F=this;this.xhr.onload=function(){F.xhrOnLoad(F.xhr);
 };this.xhr.onerror=function(){F.xhrOnError(F.xhr);};var G=new FormData();G.append('returnHTML','NO');G.append('crop',B);if(typeof(A.filename)!='undefined'){G.append('filename',A.filename);}if(typeof(A.mimetype)!='undefined'){G.append('mimetype',A.mimetype);