From: john Date: Tue, 2 Oct 2018 11:16:08 +0000 (+0800) Subject: Merge branch 'master' of http://git.roojs.com/roojs1 X-Git-Url: http://git.roojs.org/?a=commitdiff_plain;h=f18038445e8ef460a301b3203c15eb4433966db4;hp=-c;p=roojs1 Merge branch 'master' of git.roojs.com/roojs1 --- f18038445e8ef460a301b3203c15eb4433966db4 diff --combined roojs-bootstrap-debug.js index b73e72fe2f,159ef5c3a0..3c697b811e --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@@ -917,15 -917,7 +917,7 @@@ Roo.extend(Roo.bootstrap.Button, Roo.bo { return this.el.select('.roo-button-text',true).first().dom.innerHTML; }, - hide: function() { - - - this.el.hide(); - }, - show: function() { - - this.el.show(); - }, + setWeight : function(str) { this.el.removeClass(this.weightClass); @@@ -2633,7 -2625,8 +2625,7 @@@ Roo.extend(Roo.bootstrap.Modal, Roo.boo animate : true, fitwindow: false, - - + // private dialogEl: false, bodyEl: false, @@@ -2645,8 -2638,6 +2637,8 @@@ max_width: 0, + max_height: 0, + fit_content: false, onRender : function(ct, position) @@@ -2841,16 -2832,11 +2833,16 @@@ var w = Math.min(this.max_width, Roo.lib.Dom.getViewportWidth(true) - 30); if(this.height) { - this.setSize( - w, - this.height <= Roo.lib.Dom.getViewportHeight(true) - 60 ? - this.height : Roo.lib.Dom.getViewportHeight(true) - 60 - ); + this.setSize(w, this.height); + return; + } + + if(this.max_height) { + this.setSize(w,Math.min( + this.max_height, + Roo.lib.Dom.getViewportHeight(true) - 60 + )); + return; } @@@ -3043,8 -3029,7 +3035,8 @@@ for(var i = 0; i < child_nodes.length; i++) { - // for modal with tabs... + /* + * for modal with tabs... if(child_nodes[i].classList.contains('roo-layout-panel')) { var layout_childs = child_nodes[i].childNodes; @@@ -3059,6 -3044,7 +3051,6 @@@ if(layout_body_childs[k].classList.contains('navbar')) { child_height += layout_body_childs[k].offsetHeight; - // Roo.log('nav height: '+ layout_body_childs[k].offsetHeight); continue; } @@@ -3070,6 -3056,7 +3062,6 @@@ if(layout_body_tab_childs[m].classList.contains('roo-layout-active-content')) { child_height += this.getChildHeight(layout_body_tab_childs[m].childNodes); - // Roo.log('active panel height: '+this.getChildHeight(layout_body_tab_childs[m].childNodes)); continue; } @@@ -3082,10 -3069,8 +3074,10 @@@ } continue; } + */ child_height += child_nodes[i].offsetHeight; + // Roo.log(child_nodes[i].offsetHeight); } return child_height; @@@ -8323,11 -8308,6 +8315,6 @@@ clientValidation Boolean Appl return; } - if(f.xtype == 'DateField'){ - f.setVisible(false); - return; - } - f.hide(); }, this); @@@ -8343,11 -8323,6 +8330,6 @@@ return; } - if(f.xtype == 'DateField'){ - f.setVisible(true); - return; - } - f.show(); }, this); @@@ -13065,6 -13040,11 +13047,11 @@@ Roo.extend(Roo.bootstrap.ComboBox, Roo. */ useNativeIOS : false, + /** + * @cfg {Boolean} mobile_restrict_height (true|false) restrict height for touch view + */ + mobile_restrict_height : false, + ios_options : false, //private @@@ -15282,6 -15262,8 +15269,8 @@@ document.activeElement.blur(); }, this); + this._touchViewMask = Roo.DomHelper.append(document.body, {tag: "div", cls:"x-dlg-mask"}, true); + return; @@@ -15342,7 -15324,14 +15331,14 @@@ }else{ this.touchViewEl.addClass('in'); } - + + if(this._touchViewMask){ + Roo.get(document.body).addClass("x-body-masked"); + this._touchViewMask.setSize(Roo.lib.Dom.getViewWidth(true), Roo.lib.Dom.getViewHeight(true)); + this._touchViewMask.setStyle('z-index', 10000); + this._touchViewMask.addClass('show'); + } + this.doTouchViewQuery(); }, @@@ -15358,6 -15347,10 +15354,10 @@@ this.touchViewEl.setStyle('display', 'none'); } + if(this._touchViewMask){ + this._touchViewMask.removeClass('show'); + Roo.get(document.body).removeClass("x-body-masked"); + } }, setTouchViewValue : function() @@@ -15464,7 -15457,11 +15464,11 @@@ bodyHeight = bodyHeight - this.touchViewHeaderEl.getHeight(); } - var listHeight = this.touchViewListGroup.getHeight(); + var listHeight = this.touchViewListGroup.getHeight() + this.touchViewBodyEl.getPadding('tb') * 2; + + if(this.mobile_restrict_height && listHeight < bodyHeight){ + this.touchViewBodyEl.setHeight(listHeight); + } var _this = this; diff --combined roojs-bootstrap.js index 4297bdcf5f,f8cf688218..4243200d55 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@@ -33,8 -33,8 +33,8 @@@ delete A.html;}A.cls+=this.parentType== ,this.menu));}if(this.el.hasClass('roo-button')){this.el.on('click',this.onClick,this);}else{this.el.select('.roo-button').on('click',this.onClick,this);}if(this.removeClass){this.el.on('click',this.onClick,this);}this.el.enableDisplayMode();},onClick:function(e){if(this.disabled){return; }Roo.log('button on click ');if(this.preventDefault){e.preventDefault();}if(this.pressed===true||this.pressed===false){this.toggleActive(e);}this.fireEvent('click',this,e);},enable:function(){this.disabled=false;this.el.removeClass('disabled');},disable:function(){this.disabled=true; this.el.addClass('disabled');},setActive:function(v){this.el[v?'addClass':'removeClass']('active');this.pressed=v;},toggleActive:function(e){this.setActive(!this.pressed);this.fireEvent('toggle',this,e,!this.pressed);},isActive:function(){return this.el.hasClass('active'); - },setText:function(A){this.el.select('.roo-button-text',true).first().dom.innerHTML=A;},getText:function(){return this.el.select('.roo-button-text',true).first().dom.innerHTML;},hide:function(){this.el.hide();},show:function(){this.el.show();},setWeight:function(A){this.el.removeClass(this.weightClass); - this.el.addClass('btn-'+A);}}); + },setText:function(A){this.el.select('.roo-button-text',true).first().dom.innerHTML=A;},getText:function(){return this.el.select('.roo-button-text',true).first().dom.innerHTML;},setWeight:function(A){this.el.removeClass(this.weightClass);this.el.addClass('btn-'+A); + }}); // Roo/bootstrap/Column.js Roo.bootstrap.Column=function(A){Roo.bootstrap.Column.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.Column,Roo.bootstrap.Component,{xs:false,sm:false,md:false,lg:false,xsoff:false,smoff:false,mdoff:false,lgoff:false,html:'',offset:0,alert:false,fa:false,icon:false,hidden:false,fasize:1,getAutoCreate:function(){var A=Roo.apply({} ,Roo.bootstrap.Column.superclass.getAutoCreate.call(this));A={tag:'div',cls:'column'};var B=this;['xs','sm','md','lg'].map(function(D){if(B[D+'off']!==false){A.cls+=' col-'+D+'-offset-'+B[D+'off'];}if(B[D]===false){return;}if(!B[D]){A.cls+=' hidden-'+D;return; @@@ -103,7 -103,7 +103,7 @@@ this.menu=this.addxtype(Roo.apply({},th // Roo/bootstrap/MenuSeparator.js Roo.bootstrap.MenuSeparator=function(A){Roo.bootstrap.MenuSeparator.superclass.constructor.call(this,A);};Roo.extend(Roo.bootstrap.MenuSeparator,Roo.bootstrap.Component,{getAutoCreate:function(){var A={cls:'divider',tag:'li'};return A;}}); // Roo/bootstrap/Modal.js -Roo.bootstrap.Modal=function(A){Roo.bootstrap.Modal.superclass.constructor.call(this,A);this.addEvents({"btnclick":true,"resize":true});this.buttons=this.buttons||[];if(this.tmpl){this.tmpl=Roo.factory(this.tmpl);}};Roo.extend(Roo.bootstrap.Modal,Roo.bootstrap.Component,{title:'test dialog',buttons:false,html:false,tmp:false,specificTitle:false,buttonPosition:'right',allow_close:true,animate:true,fitwindow:false,dialogEl:false,bodyEl:false,footerEl:false,titleEl:false,closeEl:false,size:'',max_width:0,fit_content:false,onRender:function(ct,A){Roo.bootstrap.Component.superclass.onRender.call(this,ct,A); +Roo.bootstrap.Modal=function(A){Roo.bootstrap.Modal.superclass.constructor.call(this,A);this.addEvents({"btnclick":true,"resize":true});this.buttons=this.buttons||[];if(this.tmpl){this.tmpl=Roo.factory(this.tmpl);}};Roo.extend(Roo.bootstrap.Modal,Roo.bootstrap.Component,{title:'test dialog',buttons:false,html:false,tmp:false,specificTitle:false,buttonPosition:'right',allow_close:true,animate:true,fitwindow:false,dialogEl:false,bodyEl:false,footerEl:false,titleEl:false,closeEl:false,size:'',max_width:0,max_height:0,fit_content:false,onRender:function(ct,A){Roo.bootstrap.Component.superclass.onRender.call(this,ct,A); if(!this.el){var B=Roo.apply({},this.getAutoCreate());B.id=Roo.id();if(this.cls){B.cls+=' '+this.cls;}if(this.style){B.style=this.style;}this.el=Roo.get(document.body).createChild(B,A);}if(this.tabIndex!==undefined){this.el.dom.setAttribute('tabIndex',this.tabIndex); }this.dialogEl=this.el.select('.modal-dialog',true).first();this.bodyEl=this.el.select('.modal-body',true).first();this.closeEl=this.el.select('.modal-header .close',true).first();this.headerEl=this.el.select('.modal-header',true).first();this.titleEl=this.el.select('.modal-title',true).first(); this.footerEl=this.el.select('.modal-footer',true).first();this.maskEl=Roo.DomHelper.append(document.body,{tag:"div",cls:"x-dlg-mask"},true);if(this.buttons.length){Roo.each(this.buttons,function(bb){var b=Roo.apply({},bb);b.xns=b.xns||Roo.bootstrap;b.xtype=b.xtype||'Button'; @@@ -112,17 -112,18 +112,17 @@@ for(var i=0;i input',true).first().attr('checked',true); H.addClass('selected');}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'); - if(this.modalTitle.length){D=D-this.touchViewHeaderEl.getHeight();}var E=this.touchViewListGroup.getHeight();var F=this;if(C&&E>D){(function(){C.findParent('li').scrollIntoView(F.touchViewListGroup.dom);}).defer(500);}},onTouchViewLoadException:function(){this.hideTouchView(); - },onTouchViewEmptyResults:function(){this.clearTouchView();this.touchViewListGroup.createChild(Roo.bootstrap.ComboBox.emptyResult);this.touchViewListGroup.select('.roo-combobox-touch-view-empty-result',true).first().dom.innerHTML=this.emptyResultText;},clearTouchView:function(){this.touchViewListGroup.dom.innerHTML=''; - },onTouchViewClick:function(e,el,o){e.preventDefault();var A=o.row;var B=o.rowIndex;var r=this.store.getAt(B);if(this.fireEvent('beforeselect',this,r,B)!==false){if(!this.multiple){Roo.each(this.touchViewListGroup.select('.list-group-item > .roo-combobox-list-group-item-box > input:checked',true).elements,function(c){c.dom.removeAttribute('checked'); + if(this.modalTitle.length){D=D-this.touchViewHeaderEl.getHeight();}var E=this.touchViewListGroup.getHeight()+this.touchViewBodyEl.getPadding('tb')*2;if(this.mobile_restrict_height&&ED){(function(){C.findParent('li').scrollIntoView(F.touchViewListGroup.dom); + }).defer(500);}},onTouchViewLoadException:function(){this.hideTouchView();},onTouchViewEmptyResults:function(){this.clearTouchView();this.touchViewListGroup.createChild(Roo.bootstrap.ComboBox.emptyResult);this.touchViewListGroup.select('.roo-combobox-touch-view-empty-result',true).first().dom.innerHTML=this.emptyResultText; + },clearTouchView:function(){this.touchViewListGroup.dom.innerHTML='';},onTouchViewClick:function(e,el,o){e.preventDefault();var A=o.row;var B=o.rowIndex;var r=this.store.getAt(B);if(this.fireEvent('beforeselect',this,r,B)!==false){if(!this.multiple){Roo.each(this.touchViewListGroup.select('.list-group-item > .roo-combobox-list-group-item-box > input:checked',true).elements,function(c){c.dom.removeAttribute('checked'); },this);A.select('.roo-combobox-list-group-item-box > input',true).first().attr('checked',true);this.setFromData(r.data);var C=this.closeTriggerEl();if(C){C.show();}this.hideTouchView();this.fireEvent('select',this,r,B);return;}if(this.valueField&&typeof(r.data[this.valueField])!='undefined'&&this.getValue().indexOf(r.data[this.valueField])!=-1){A.select('.roo-combobox-list-group-item-box > input',true).first().dom.removeAttribute('checked'); this.tickItems.splice(this.tickItems.indexOf(r.data),1);return;}A.select('.roo-combobox-list-group-item-box > input',true).first().attr('checked',true);this.addItem(r.data);this.tickItems.push(r.data);}},getAutoCreateNativeIOS:function(){var A={cls:'form-group'} ;var B={tag:'select',cls:'roo-ios-select'};if(this.name){B.name=this.name;}if(this.disabled){B.disabled=true;}var C=this;['xs','sm','md','lg'].map(function(D){if(C[D]){A.cls+=' col-'+D+'-'+C[D];}});A.cn=B;return A;},initIOSView:function(){this.store.on('load',this.onIOSViewLoad,this);