roojs-core.js
authorAlan Knowles <alan@roojs.com>
Thu, 11 Feb 2021 04:23:38 +0000 (12:23 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 11 Feb 2021 04:23:38 +0000 (12:23 +0800)
roojs-core-debug.js
roojs-bootstrap.js
roojs-bootstrap-debug.js
roojs-all.js
roojs-debug.js

roojs-all.js
roojs-bootstrap-debug.js
roojs-bootstrap.js
roojs-core-debug.js
roojs-core.js
roojs-debug.js

index cf101e6..6984bde 100644 (file)
@@ -33,8 +33,8 @@ return A.replace(/\{(\d+)\}/g,function(m,i){return Roo.util.Format.htmlEncode(B[
 Roo.applyIf(Number.prototype,{constrain:function(A,B){return Math.min(Math.max(this,A),B);}});
 // Array.js
 Roo.applyIf(Array.prototype,{indexOf:function(o){for(var i=0,A=this.length;i<A;i++){if(this[i]==o){return i;}}return -1;},remove:function(o){var A=this.indexOf(o);if(A!=-1){this.splice(A,1);}},map:function(A){var B=this.length>>>0;if(typeof A!="function"){throw new TypeError();
-}var C=new Array(B);var D=arguments[1];for(var i=0;i<B;i++){if(i in this){C[i]=A.call(D,this[i],i,this);}}return C;},equals:function(o){if(a===b){return true;}if(a==null||b==null){return false;}if(a.length!==b.length){return false;}for(var i=0;i<a.length;
-++i){if(a[i]!==b[i]){return false;}}return true;}});
+}var C=new Array(B);var D=arguments[1];for(var i=0;i<B;i++){if(i in this){C[i]=A.call(D,this[i],i,this);}}return C;},equals:function(b){if(this===b){return true;}if(b==null){return false;}if(this.length!==b.length){return false;}for(var i=0;i<this.length;
+++i){if(this[i]!==b[i]){return false;}}return true;}});
 // Date.js
 Date.prototype.getElapsed=function(A){return Math.abs((A||new Date()).getTime()-this.getTime());};Date.parseFunctions={count:0};Date.parseRegexes=[];Date.formatFunctions={count:0};Date.prototype.dateFormat=function(A){if(Date.formatFunctions[A]==null){Date.createNewFormat(A);
 }var B=Date.formatFunctions[A];return this[B]();};Date.prototype.format=Date.prototype.dateFormat;Date.createNewFormat=function(A){var B="format"+Date.formatFunctions.count++;Date.formatFunctions[A]=B;var C="Date.prototype."+B+" = function(){return ";var D=false;
index 2f42775..6fbdf1d 100644 (file)
@@ -19877,6 +19877,8 @@ Roo.extend(Roo.bootstrap.Popover, Roo.bootstrap.Component,  {
             
         }
         
+        this.alignEl = on_el;
+
         if (!this.el) {
             this.render(document.body);
         }
@@ -19892,9 +19894,8 @@ Roo.extend(Roo.bootstrap.Popover, Roo.bootstrap.Component,  {
         this.el.show();
         this.el.dom.style.display = 'block';
          
-        
  
-        if (on_el) {
+        if (this.alignEl) {
             this.updatePosition(this.placement, true);
              
         } else {
index eeda1f9..6cd19cf 100644 (file)
@@ -819,15 +819,16 @@ this.headerEl.setVisibilityMode(Roo.Element.DISPLAY);this.el.enableDisplayMode('
 var B=this.trigger?this.trigger.split(' '):[];Roo.each(B,function(C){if(C=='click'){A.on('click',this.toggle,this);}else if(C!='manual'){var D=C=='hover'?'mouseenter':'focusin';var E=C=='hover'?'mouseleave':'focusout';A.on(D,this.enter,this);A.on(E,this.leave,this);
 }},this);},timeout:null,hoverState:null,toggle:function(){this.hoverState=='in'?this.leave():this.enter();},enter:function(){clearTimeout(this.timeout);this.hoverState='in';if(!this.delay||!this.delay.show){this.show();return;}var _t=this;this.timeout=setTimeout(function(){if(_t.hoverState=='in'){_t.show();
 }},this.delay.show)},leave:function(){clearTimeout(this.timeout);this.hoverState='out';if(!this.delay||!this.delay.hide){this.hide();return;}var _t=this;this.timeout=setTimeout(function(){if(_t.hoverState=='out'){_t.hide();}},this.delay.hide)},show:function(A,B){this.placement=typeof(B)=='undefined'?this.placement:B;
-A=A||false;if(!A){if(this.parent()&&(this.over=='parent'||(this.over===false))){A=this.parent().el;}else if(this.over){Roo.get(this.over);}}if(!this.el){this.render(document.body);}if(this.title===false){this.headerEl.hide();}this.el.show();this.el.dom.style.display='block';
-if(A){this.updatePosition(this.placement,true);}else{var es=this.el.getSize();var x=Roo.lib.Dom.getViewWidth()/2;var y=Roo.lib.Dom.getViewHeight()/2;this.el.setXY([x-(es.width/2),y-(es.height/2)]);}this.el.addClass('in');this.hoverState='in';if(this.modal){this.maskEl.setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(true));
-this.maskEl.setStyle('z-index',Roo.bootstrap.Popover.zIndex++);this.maskEl.dom.style.display='block';this.maskEl.addClass('show');}this.el.setStyle('z-index',Roo.bootstrap.Popover.zIndex++);this.fireEvent('show',this);},updatePosition:function(A,B){A=A===false?this.placement:A;
-this.el.removeClass(['fade','top','bottom','left','right','in','bs-popover-top','bs-popover-bottom','bs-popover-left','bs-popover-right']);this.el.addClass(A+' roo-popover-'+A);if(!this.alignEl){return false;}switch(A){case 'right':var C=this.el.getAlignToXY(this.alignEl,'tl-tr',[10,0]);
-var D=this.el.getAlignToXY(this.alignEl,'tl-tr?',[10,0]);if(!B||C.equals(D)||C[0]==D[0]){this.setXY(D);var xy=this.alignEl.getAnchorXY('tr',false);xy[0]+=2;xy[1]+=5;this.arrowEl.setXY(xy);return true;}B=false;case 'left':var C=this.el.getAlignToXY(this.alignEl,'tr-tl',[-10,0]);
-var D=this.el.getAlignToXY(this.alignEl,'tr-tl?',[-10,0]);if(!B||C.equals(D)||C[0]==D[0]){this.setXY(D);var xy=this.alignEl.getAnchorXY('tl',false);xy[0]+=2;xy[1]+=5;this.arrowEl.setXY(xy);return true;}return this.updatePosition('right',false);case 'top':var C=this.el.getAlignToXY(this.alignEl,'t-b',[0,-10]);
-var D=this.el.getAlignToXY(this.alignEl,'t-b?',[0,-10]);if(!B||C.equals(D)||C[1]==D[1]){this.setXY(D);var xy=this.alignEl.getAnchorXY('b',false);xy[0]+=2;xy[1]+=5;this.arrowEl.setXY(xy);return true;}B=false;case 'bottom':var C=this.el.getAlignToXY(this.alignEl,'b-t',[0,10]);
-var D=this.el.getAlignToXY(this.alignEl,'b-t?',[0,10]);if(!B||C.equals(D)||C[1]==D[1]){this.setXY(D);var xy=this.alignEl.getAnchorXY('t',false);xy[0]+=2;xy[1]+=5;this.arrowEl.setXY(xy);return true;}return this.updatePosition('top',false);}return false;},hide:function(){this.el.setXY([0,0]);
-this.el.removeClass('in');this.el.hide();this.hoverState=null;this.maskEl.hide();this.fireEvent('hide',this);}});Roo.apply(Roo.bootstrap.Popover,{alignment:{'left':['r-l',[-10,0],'left bs-popover-left'],'right':['l-br',[10,0],'right bs-popover-right'],'bottom':['t-b',[0,10],'top bs-popover-top'],'top':['b-t',[0,-10],'bottom bs-popover-bottom']}
+A=A||false;if(!A){if(this.parent()&&(this.over=='parent'||(this.over===false))){A=this.parent().el;}else if(this.over){Roo.get(this.over);}}this.alignEl=A;if(!this.el){this.render(document.body);}if(this.title===false){this.headerEl.hide();}this.el.show();
+this.el.dom.style.display='block';if(this.alignEl){this.updatePosition(this.placement,true);}else{var es=this.el.getSize();var x=Roo.lib.Dom.getViewWidth()/2;var y=Roo.lib.Dom.getViewHeight()/2;this.el.setXY([x-(es.width/2),y-(es.height/2)]);}this.el.addClass('in');
+this.hoverState='in';if(this.modal){this.maskEl.setSize(Roo.lib.Dom.getViewWidth(true),Roo.lib.Dom.getViewHeight(true));this.maskEl.setStyle('z-index',Roo.bootstrap.Popover.zIndex++);this.maskEl.dom.style.display='block';this.maskEl.addClass('show');}this.el.setStyle('z-index',Roo.bootstrap.Popover.zIndex++);
+this.fireEvent('show',this);},updatePosition:function(A,B){A=A===false?this.placement:A;this.el.removeClass(['fade','top','bottom','left','right','in','bs-popover-top','bs-popover-bottom','bs-popover-left','bs-popover-right']);this.el.addClass(A+' roo-popover-'+A);
+if(!this.alignEl){return false;}switch(A){case 'right':var C=this.el.getAlignToXY(this.alignEl,'tl-tr',[10,0]);var D=this.el.getAlignToXY(this.alignEl,'tl-tr?',[10,0]);if(!B||C.equals(D)||C[0]==D[0]){this.setXY(D);var xy=this.alignEl.getAnchorXY('tr',false);
+xy[0]+=2;xy[1]+=5;this.arrowEl.setXY(xy);return true;}B=false;case 'left':var C=this.el.getAlignToXY(this.alignEl,'tr-tl',[-10,0]);var D=this.el.getAlignToXY(this.alignEl,'tr-tl?',[-10,0]);if(!B||C.equals(D)||C[0]==D[0]){this.setXY(D);var xy=this.alignEl.getAnchorXY('tl',false);
+xy[0]+=2;xy[1]+=5;this.arrowEl.setXY(xy);return true;}return this.updatePosition('right',false);case 'top':var C=this.el.getAlignToXY(this.alignEl,'t-b',[0,-10]);var D=this.el.getAlignToXY(this.alignEl,'t-b?',[0,-10]);if(!B||C.equals(D)||C[1]==D[1]){this.setXY(D);
+var xy=this.alignEl.getAnchorXY('b',false);xy[0]+=2;xy[1]+=5;this.arrowEl.setXY(xy);return true;}B=false;case 'bottom':var C=this.el.getAlignToXY(this.alignEl,'b-t',[0,10]);var D=this.el.getAlignToXY(this.alignEl,'b-t?',[0,10]);if(!B||C.equals(D)||C[1]==D[1]){this.setXY(D);
+var xy=this.alignEl.getAnchorXY('t',false);xy[0]+=2;xy[1]+=5;this.arrowEl.setXY(xy);return true;}return this.updatePosition('top',false);}return false;},hide:function(){this.el.setXY([0,0]);this.el.removeClass('in');this.el.hide();this.hoverState=null;this.maskEl.hide();
+this.fireEvent('hide',this);}});Roo.apply(Roo.bootstrap.Popover,{alignment:{'left':['r-l',[-10,0],'left bs-popover-left'],'right':['l-br',[10,0],'right bs-popover-right'],'bottom':['t-b',[0,10],'top bs-popover-top'],'top':['b-t',[0,-10],'bottom bs-popover-bottom']}
 ,zIndex:20001,clickHander:false,onMouseDown:function(e){if(!e.getTarget(".roo-popover")){this.hideAll();}},popups:[],register:function(A){if(!Roo.bootstrap.Popover.clickHandler){Roo.bootstrap.Popover.clickHandler=Roo.get(document).on("mousedown",Roo.bootstrap.Popover.onMouseDown,Roo.bootstrap.Popover);
 }this.hideAll();this.popups.push(A);},hideAll:function(){this.popups.forEach(function(p){p.hide();});}});
 // Roo/bootstrap/PopoverNav.js
index 2032f93..0b1f7e7 100644 (file)
@@ -1021,23 +1021,23 @@ Roo.applyIf(Array.prototype, {
      * @param {Array} o The array to compare to
      * @returns {Boolean} true if the same
      */
-    equals : function(o)
+    equals : function(b)
     {
         // https://stackoverflow.com/questions/3115982/how-to-check-if-two-arrays-are-equal-with-javascript
-       if (a === b) {
+       if (this === b) {
            return true;
         }
-       if (a == null || b == null) {
+       if (b == null) {
            return false;
        }
-       if (a.length !== b.length) {
+       if (this.length !== b.length) {
            return false;
        }
       
        // sort?? a.sort().equals(b.sort());
       
-       for (var i = 0; i < a.length; ++i) {
-           if (a[i] !== b[i]) {
+       for (var i = 0; i < this.length; ++i) {
+           if (this[i] !== b[i]) {
                return false;
            }
        }
index bd26860..5ef6215 100644 (file)
@@ -33,8 +33,8 @@ return A.replace(/\{(\d+)\}/g,function(m,i){return Roo.util.Format.htmlEncode(B[
 Roo.applyIf(Number.prototype,{constrain:function(A,B){return Math.min(Math.max(this,A),B);}});
 // Array.js
 Roo.applyIf(Array.prototype,{indexOf:function(o){for(var i=0,A=this.length;i<A;i++){if(this[i]==o){return i;}}return -1;},remove:function(o){var A=this.indexOf(o);if(A!=-1){this.splice(A,1);}},map:function(A){var B=this.length>>>0;if(typeof A!="function"){throw new TypeError();
-}var C=new Array(B);var D=arguments[1];for(var i=0;i<B;i++){if(i in this){C[i]=A.call(D,this[i],i,this);}}return C;},equals:function(o){if(a===b){return true;}if(a==null||b==null){return false;}if(a.length!==b.length){return false;}for(var i=0;i<a.length;
-++i){if(a[i]!==b[i]){return false;}}return true;}});
+}var C=new Array(B);var D=arguments[1];for(var i=0;i<B;i++){if(i in this){C[i]=A.call(D,this[i],i,this);}}return C;},equals:function(b){if(this===b){return true;}if(b==null){return false;}if(this.length!==b.length){return false;}for(var i=0;i<this.length;
+++i){if(this[i]!==b[i]){return false;}}return true;}});
 // Date.js
 Date.prototype.getElapsed=function(A){return Math.abs((A||new Date()).getTime()-this.getTime());};Date.parseFunctions={count:0};Date.parseRegexes=[];Date.formatFunctions={count:0};Date.prototype.dateFormat=function(A){if(Date.formatFunctions[A]==null){Date.createNewFormat(A);
 }var B=Date.formatFunctions[A];return this[B]();};Date.prototype.format=Date.prototype.dateFormat;Date.createNewFormat=function(A){var B="format"+Date.formatFunctions.count++;Date.formatFunctions[A]=B;var C="Date.prototype."+B+" = function(){return ";var D=false;
index 5b5cec0..7b65ff1 100644 (file)
@@ -1021,23 +1021,23 @@ Roo.applyIf(Array.prototype, {
      * @param {Array} o The array to compare to
      * @returns {Boolean} true if the same
      */
-    equals : function(o)
+    equals : function(b)
     {
         // https://stackoverflow.com/questions/3115982/how-to-check-if-two-arrays-are-equal-with-javascript
-       if (a === b) {
+       if (this === b) {
            return true;
         }
-       if (a == null || b == null) {
+       if (b == null) {
            return false;
        }
-       if (a.length !== b.length) {
+       if (this.length !== b.length) {
            return false;
        }
       
        // sort?? a.sort().equals(b.sort());
       
-       for (var i = 0; i < a.length; ++i) {
-           if (a[i] !== b[i]) {
+       for (var i = 0; i < this.length; ++i) {
+           if (this[i] !== b[i]) {
                return false;
            }
        }