From aa9d624606614eca7bfd858caf9bc0636d033435 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Thu, 11 Feb 2021 12:40:05 +0800 Subject: [PATCH] sync --- docs/src/Array.js.html | 12 ++++----- docs/src/Roo_bootstrap_Popover.js.html | 35 ++++++++++++++------------ 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/docs/src/Array.js.html b/docs/src/Array.js.html index d1e4096f7a..acf5ea3386 100644 --- a/docs/src/Array.js.html +++ b/docs/src/Array.js.html @@ -61,23 +61,23 @@ * @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; } } diff --git a/docs/src/Roo_bootstrap_Popover.js.html b/docs/src/Roo_bootstrap_Popover.js.html index 6d6e69d6dd..c526feab80 100644 --- a/docs/src/Roo_bootstrap_Popover.js.html +++ b/docs/src/Roo_bootstrap_Popover.js.html @@ -281,6 +281,8 @@ } + this.alignEl = on_el; + if (!this.el) { this.render(document.body); } @@ -297,8 +299,7 @@ this.el.dom.style.display = 'block'; - - if (on_el) { + if (this.alignEl) { this.updatePosition(this.placement, true); } else { @@ -338,13 +339,15 @@ */ updatePosition : function(placement, try_move) { - placement = placement === false ? this.placement : placement; + // allow for calling with no parameters + placement = placement ? placement : this.placement; + try_move = typeof(try_move) == 'undefined' ? true : try_move; this.el.removeClass([ 'fade','top','bottom', 'left', 'right','in', 'bs-popover-top','bs-popover-bottom', 'bs-popover-left', 'bs-popover-right' ]); - this.el.addClass(placement + ' roo-popover-' + placement); + this.el.addClass(placement + ' bs-popover-' + placement); if (!this.alignEl ) { return false; @@ -356,7 +359,7 @@ var offset = this.el.getAlignToXY(this.alignEl, 'tl-tr?',[10,0]); if (!try_move || exact.equals(offset) || exact[0] == offset[0] ) { //normal display... or moved up/down. - this.setXY(offset); + this.el.setXY(offset); var xy = this.alignEl.getAnchorXY('tr', false); xy[0]+=2;xy[1]+=5; this.arrowEl.setXY(xy); @@ -371,7 +374,7 @@ var offset = this.el.getAlignToXY(this.alignEl, 'tr-tl?',[-10,0]); if (!try_move || exact.equals(offset) || exact[0] == offset[0] ) { //normal display... or moved up/down. - this.setXY(offset); + this.el.setXY(offset); var xy = this.alignEl.getAnchorXY('tl', false); xy[0]+=2;xy[1]+=5; // << fix me this.arrowEl.setXY(xy); @@ -381,13 +384,13 @@ return this.updatePosition('right', false); case 'top': - var exact = this.el.getAlignToXY(this.alignEl, 't-b', [0,-10]); - var offset = this.el.getAlignToXY(this.alignEl, 't-b?',[0,-10]); + var exact = this.el.getAlignToXY(this.alignEl, 'b-t', [0,-10]); + var offset = this.el.getAlignToXY(this.alignEl, 'b-t?',[0,-10]); if (!try_move || exact.equals(offset) || exact[1] == offset[1] ) { //normal display... or moved up/down. - this.setXY(offset); - var xy = this.alignEl.getAnchorXY('b', false); - xy[0]+=2;xy[1]+=5; // << fix me + this.el.setXY(offset); + var xy = this.alignEl.getAnchorXY('t', false); + xy[1]-=10; // << fix me this.arrowEl.setXY(xy); return true; } @@ -395,13 +398,13 @@ try_move = false; case 'bottom': - var exact = this.el.getAlignToXY(this.alignEl, 'b-t', [0,10]); - var offset = this.el.getAlignToXY(this.alignEl, 'b-t?',[0,10]); + var exact = this.el.getAlignToXY(this.alignEl, 't-b', [0,10]); + var offset = this.el.getAlignToXY(this.alignEl, 't-b?',[0,10]); if (!try_move || exact.equals(offset) || exact[1] == offset[1] ) { //normal display... or moved up/down. - this.setXY(offset); - var xy = this.alignEl.getAnchorXY('t', false); - xy[0]+=2;xy[1]+=5; // << fix me + this.el.setXY(offset); + var xy = this.alignEl.getAnchorXY('b', false); + xy[1]+=2; // << fix me this.arrowEl.setXY(xy); return true; } -- 2.39.2