diff --git a/SidePane.js b/SidePane.js index 554675f680..9c00f7669a 100644 --- a/SidePane.js +++ b/SidePane.js @@ -101,6 +101,10 @@ define([ _originX: NaN, _originY: NaN, + attachedCallback: function () { + this.parentNode.style.overflow = "hidden"; + }, + show: dcl.superCall(function (sup) { return function () { if (arguments.length > 0) { @@ -275,7 +279,6 @@ define([ }, refreshRendering: function (props) { - this.parentNode.style.overflow = "hidden"; if (!("mode" in props || "position" in props || "animate" in props)) { return; } diff --git a/tests/unit/SidePane.js b/tests/unit/SidePane.js index 6b100eae6b..3ba028b8b5 100644 --- a/tests/unit/SidePane.js +++ b/tests/unit/SidePane.js @@ -15,14 +15,13 @@ define([ origBodyStyle = document.body.style.cssText; node = new SidePane(); document.body.appendChild(node); - register.parse(); node.show(); }, "Default values" : function () { - assert.deepEqual(node.mode, "push"); - assert.deepEqual(node.position, "start"); - assert.deepEqual(node.animate, true); - assert.deepEqual(node.swipeClosing, true); + assert.strictEqual(node.mode, "push"); + assert.strictEqual(node.position, "start"); + assert.isTrue(node.animate, "node.animate"); + assert.isTrue(node.swipeClosing, "node.swipeClosing"); }, "Size Computation" : function () { var box = domGeom.getMarginBox(node);