X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=roojs-debug.js;h=5b5cec0dc33984485872052a983c9ce5fe7b3275;hb=e0d40dd30b73a8b7bfda7a17448bbcb994cb48ba;hp=da29d8a68a0cf144c6c004627825d3ff1c7d0cfb;hpb=cc14bf6bc18b98163c5eee1ee68c54fb56a89858;p=roojs1 diff --git a/roojs-debug.js b/roojs-debug.js index da29d8a68a..5b5cec0dc3 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -1015,8 +1015,34 @@ Roo.applyIf(Array.prototype, { } return res; + }, + /** + * equals + * @param {Array} o The array to compare to + * @returns {Boolean} true if the same + */ + equals : function(o) + { + // https://stackoverflow.com/questions/3115982/how-to-check-if-two-arrays-are-equal-with-javascript + if (a === b) { + return true; + } + if (a == null || b == null) { + return false; + } + if (a.length !== b.length) { + return false; + } + + // sort?? a.sort().equals(b.sort()); + + for (var i = 0; i < a.length; ++i) { + if (a[i] !== b[i]) { + return false; + } + } + return true; } - }); @@ -8562,7 +8588,8 @@ if(opt.anim.isAnimated()){ * @param {Array} offsets (optional) Offset the positioning by [x, y] * @return {Array} [x, y] */ - getAlignToXY : function(el, p, o){ + getAlignToXY : function(el, p, o) + { el = Roo.get(el); var d = this.dom; if(!el.dom){ @@ -8603,7 +8630,7 @@ if(opt.anim.isAnimated()){ //otherwise swap the aligned el to the opposite border of the target. var p1y = p1.charAt(0), p1x = p1.charAt(p1.length-1); var p2y = p2.charAt(0), p2x = p2.charAt(p2.length-1); - var swapY = ((p1y=="t" && p2y=="b") || (p1y=="b" && p2y=="t")); + var swapY = ((p1y=="t" && p2y=="b") || (p1y=="b" && p2y=="t") ); var swapX = ((p1x=="r" && p2x=="l") || (p1x=="l" && p2x=="r")); var doc = document;