roojs-bootstrap.js
authoredward <edward@roojs.com>
Wed, 15 Jun 2016 04:37:17 +0000 (12:37 +0800)
committeredward <edward@roojs.com>
Wed, 15 Jun 2016 04:37:17 +0000 (12:37 +0800)
roojs-bootstrap-debug.js

roojs-bootstrap-debug.js
roojs-bootstrap.js

index de0374a..175bd56 100644 (file)
@@ -13579,6 +13579,8 @@ Roo.extend(Roo.bootstrap.ComboBox, Roo.bootstrap.TriggerField, {
             this.el.dom.scrollTop = 0;
         }, this);
         
+        this.originalValue = this.getValue();
+        
         this.inputEl().on("click", this.showTouchView, this);
         
         this.touchViewFooterEl.select('.roo-touch-view-cancel', true).first().on('click', this.hideTouchView, this);
index d63a0db..10f0ce8 100644 (file)
@@ -533,20 +533,20 @@ var A={cls:'form-group'};var B={tag:'input',id:id,type:this.inputType,cls:'form-
 );}if(this.hasFeedback&&!this.allowBlank){C.cls+=' has-feedback';C.cn.push({tag:'span',cls:'glyphicon form-control-feedback'});}if(this.after){C.cls+=(this.before)?'':' input-group';C.cn.push({tag:'span',cls:'input-group-addon',html:this.after});}var D={tag:'div',cn:[{tag:'input',type:'hidden',cls:'form-hidden-field'}
 ,C]};if(this.multiple){D={tag:'div',cn:[{tag:'input',type:'hidden',cls:'form-hidden-field'},{tag:'ul',cls:'select2-choices',cn:[{tag:'li',cls:'select2-search-field',cn:[C]}]}]}};var E={cls:'select2-container input-group',cn:[D]};if(this.multiple){E.cls+=' select2-container-multi';
 }var F=this.labelAlign||this.parentLabelAlign();A.cn=E;if(this.fieldLabel.length){var lw=F==='left'?('col-sm'+this.labelWidth):'';var cw=F==='left'?('col-sm'+(12-this.labelWidth)):'';A.cn=[{tag:'label',cls:'control-label '+lw,html:this.fieldLabel},{cls:cw,cn:[E]}
-];}var G=this;['xs','sm','md','lg'].map(function(H){if(G[H]){A.cls+=' col-'+H+'-'+G[H];}});return A;},initTouchView:function(){this.renderTouchView();this.touchViewEl.on('scroll',function(){this.el.dom.scrollTop=0;},this);this.inputEl().on("click",this.showTouchView,this);
-this.touchViewFooterEl.select('.roo-touch-view-cancel',true).first().on('click',this.hideTouchView,this);this.touchViewFooterEl.select('.roo-touch-view-ok',true).first().on('click',this.setTouchViewValue,this);this.maskEl=new Roo.LoadMask(this.touchViewEl,{store:this.store,msgCls:'roo-el-mask-msg'}
-);this.store.on('beforeload',this.onTouchViewBeforeLoad,this);this.store.on('load',this.onTouchViewLoad,this);this.store.on('loadexception',this.onTouchViewLoadException,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);}if(this.multiple){this.choices=this.el.select('ul.select2-choices',true).first();
-this.searchField=this.el.select('ul li.select2-search-field',true).first();}if(this.removable&&!this.multiple){var A=this.closeTriggerEl();if(A){A.setVisibilityMode(Roo.Element.DISPLAY).hide();A.on('click',this.removeBtnClick,this,A);}}this.inputEl().on("focus",function(e){document.activeElement.blur();
-},this);return;},renderTouchView:function(){this.touchViewEl=Roo.get(document.body).createChild(Roo.bootstrap.ComboBox.touchViewTemplate);this.touchViewEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.touchViewHeaderEl=this.touchViewEl.select('.modal-header',true).first();
-this.touchViewHeaderEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.touchViewBodyEl=this.touchViewEl.select('.modal-body',true).first();this.touchViewBodyEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.touchViewBodyEl.setStyle('overflow','auto');
-this.touchViewListGroup=this.touchViewBodyEl.select('.list-group',true).first();this.touchViewListGroup.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.touchViewFooterEl=this.touchViewEl.select('.modal-footer',true).first();this.touchViewFooterEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';
-},showTouchView:function(){if(this.disabled){return;}this.touchViewHeaderEl.hide();if(this.fieldLabel.length){this.touchViewHeaderEl.dom.innerHTML=this.fieldLabel;this.touchViewHeaderEl.show();}this.touchViewEl.show();this.touchViewEl.select('.modal-dialog',true).first().setStyle('margin','0px');
-this.touchViewEl.select('.modal-dialog > .modal-content',true).first().setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(true));var A=Roo.lib.Dom.getViewHeight()-this.touchViewFooterEl.getHeight()+this.touchViewBodyEl.getPadding('tb');if(this.fieldLabel.length){A=A-this.touchViewHeaderEl.getHeight();
-}this.touchViewBodyEl.setHeight(A);if(this.animate){var B=this;(function(){B.touchViewEl.addClass('in');}).defer(50);}else{this.touchViewEl.addClass('in');}this.doTouchViewQuery();},hideTouchView:function(){this.touchViewEl.removeClass('in');if(this.animate){var A=this;
-(function(){A.touchViewEl.setStyle('display','none');}).defer(150);}else{this.touchViewEl.setStyle('display','none');}},setTouchViewValue:function(){if(this.multiple){this.clearItem();var A=this;Roo.each(this.tickItems,function(o){this.addItem(o);},this);
-}this.hideTouchView();},doTouchViewQuery:function(){var qe={query:'',forceAll:true,combo:this,cancel:false};if(this.fireEvent('beforequery',qe)===false||qe.cancel){return false;}if(!this.alwaysQuery||this.mode=='local'){this.onTouchViewLoad();return;}this.store.load();
-},onTouchViewBeforeLoad:function(A,B){return;},onTouchViewLoad:function(){if(this.store.getCount()<1){this.onTouchViewEmptyResults();return;}this.clearTouchView();var A=this.getRawValue();var B=(this.multiple)?Roo.bootstrap.ComboBox.listItemCheckbox:Roo.bootstrap.ComboBox.listItemRadio;
+];}var G=this;['xs','sm','md','lg'].map(function(H){if(G[H]){A.cls+=' col-'+H+'-'+G[H];}});return A;},initTouchView:function(){this.renderTouchView();this.touchViewEl.on('scroll',function(){this.el.dom.scrollTop=0;},this);this.originalValue=this.getValue();
+this.inputEl().on("click",this.showTouchView,this);this.touchViewFooterEl.select('.roo-touch-view-cancel',true).first().on('click',this.hideTouchView,this);this.touchViewFooterEl.select('.roo-touch-view-ok',true).first().on('click',this.setTouchViewValue,this);
+this.maskEl=new Roo.LoadMask(this.touchViewEl,{store:this.store,msgCls:'roo-el-mask-msg'});this.store.on('beforeload',this.onTouchViewBeforeLoad,this);this.store.on('load',this.onTouchViewLoad,this);this.store.on('loadexception',this.onTouchViewLoadException,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);
+}if(this.multiple){this.choices=this.el.select('ul.select2-choices',true).first();this.searchField=this.el.select('ul li.select2-search-field',true).first();}if(this.removable&&!this.multiple){var A=this.closeTriggerEl();if(A){A.setVisibilityMode(Roo.Element.DISPLAY).hide();
+A.on('click',this.removeBtnClick,this,A);}}this.inputEl().on("focus",function(e){document.activeElement.blur();},this);return;},renderTouchView:function(){this.touchViewEl=Roo.get(document.body).createChild(Roo.bootstrap.ComboBox.touchViewTemplate);this.touchViewEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';
+this.touchViewHeaderEl=this.touchViewEl.select('.modal-header',true).first();this.touchViewHeaderEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.touchViewBodyEl=this.touchViewEl.select('.modal-body',true).first();this.touchViewBodyEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';
+this.touchViewBodyEl.setStyle('overflow','auto');this.touchViewListGroup=this.touchViewBodyEl.select('.list-group',true).first();this.touchViewListGroup.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';this.touchViewFooterEl=this.touchViewEl.select('.modal-footer',true).first();
+this.touchViewFooterEl.setVisibilityMode(Roo.Element.DISPLAY).originalDisplay='block';},showTouchView:function(){if(this.disabled){return;}this.touchViewHeaderEl.hide();if(this.fieldLabel.length){this.touchViewHeaderEl.dom.innerHTML=this.fieldLabel;this.touchViewHeaderEl.show();
+}this.touchViewEl.show();this.touchViewEl.select('.modal-dialog',true).first().setStyle('margin','0px');this.touchViewEl.select('.modal-dialog > .modal-content',true).first().setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(true));var A=Roo.lib.Dom.getViewHeight()-this.touchViewFooterEl.getHeight()+this.touchViewBodyEl.getPadding('tb');
+if(this.fieldLabel.length){A=A-this.touchViewHeaderEl.getHeight();}this.touchViewBodyEl.setHeight(A);if(this.animate){var B=this;(function(){B.touchViewEl.addClass('in');}).defer(50);}else{this.touchViewEl.addClass('in');}this.doTouchViewQuery();},hideTouchView:function(){this.touchViewEl.removeClass('in');
+if(this.animate){var A=this;(function(){A.touchViewEl.setStyle('display','none');}).defer(150);}else{this.touchViewEl.setStyle('display','none');}},setTouchViewValue:function(){if(this.multiple){this.clearItem();var A=this;Roo.each(this.tickItems,function(o){this.addItem(o);
+},this);}this.hideTouchView();},doTouchViewQuery:function(){var qe={query:'',forceAll:true,combo:this,cancel:false};if(this.fireEvent('beforequery',qe)===false||qe.cancel){return false;}if(!this.alwaysQuery||this.mode=='local'){this.onTouchViewLoad();return;
+}this.store.load();},onTouchViewBeforeLoad:function(A,B){return;},onTouchViewLoad:function(){if(this.store.getCount()<1){this.onTouchViewEmptyResults();return;}this.clearTouchView();var A=this.getRawValue();var B=(this.multiple)?Roo.bootstrap.ComboBox.listItemCheckbox:Roo.bootstrap.ComboBox.listItemRadio;
 this.tickItems=[];this.store.data.each(function(d,G){var H=this.touchViewListGroup.createChild(B);if(this.displayField&&typeof(d.data[this.displayField])!='undefined'){var I={data:d.data,html:d.data[this.displayField]};if(this.fireEvent('touchviewdisplay',this,I)!==false){H.select('.roo-combobox-list-group-item-value',true).first().dom.innerHTML=I.html;
 }}if(!this.multiple&&this.valueField&&typeof(d.data[this.valueField])!='undefined'&&d.data[this.valueField]==this.getValue()){H.select('.roo-combobox-list-group-item-box > input',true).first().attr('checked',true);}if(this.multiple&&this.valueField&&typeof(d.data[this.valueField])!='undefined'&&this.getValue().indexOf(d.data[this.valueField])!=-1){H.select('.roo-combobox-list-group-item-box > input',true).first().attr('checked',true);
 this.tickItems.push(d.data);}H.on('click',this.onTouchViewClick,this,{row:H,rowIndex:G});},this);var C=this.touchViewListGroup.select('.list-group-item > .roo-combobox-list-group-item-box > input:checked',true).first();var D=Roo.lib.Dom.getViewHeight()-this.touchViewFooterEl.getHeight()+this.touchViewBodyEl.getPadding('tb');