From d2edb294b7fe6db96367e956b4ceeb5a6f63ec61 Mon Sep 17 00:00:00 2001 From: Dan Beam Date: Tue, 16 Feb 2016 17:08:32 -0800 Subject: [PATCH 1/9] Make paper-drawer-panel#rightDrawer default to true in RTL --- paper-drawer-panel.html | 8 +++++++- test/index.html | 2 ++ test/rtl.html | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 test/rtl.html diff --git a/paper-drawer-panel.html b/paper-drawer-panel.html index 8dc8b1e..730d130 100644 --- a/paper-drawer-panel.html +++ b/paper-drawer-panel.html @@ -469,7 +469,9 @@ */ rightDrawer: { type: Boolean, - value: false + value: function() { + return this._isRTL(); + }, }, /** @@ -550,6 +552,10 @@ this._transition = true; }, + _isRTL: function() { + return window.getComputedStyle(this).direction == 'rtl'; + }, + _onMainTransitionEnd: function (e) { if (e.currentTarget === this.$.main && (e.propertyName === 'left' || e.propertyName === 'right')) { this.notifyResize(); diff --git a/test/index.html b/test/index.html index 1509baa..09c150c 100644 --- a/test/index.html +++ b/test/index.html @@ -19,8 +19,10 @@ diff --git a/test/rtl.html b/test/rtl.html new file mode 100644 index 0000000..07aa122 --- /dev/null +++ b/test/rtl.html @@ -0,0 +1,40 @@ + + + + + + paper-drawer-panel tests + + + + + + + + + + + + + From 287c331554d3b58bcd4152807c8dfb27f159425c Mon Sep 17 00:00:00 2001 From: Dan Beam Date: Tue, 16 Feb 2016 17:18:37 -0800 Subject: [PATCH 2/9] doh --- test/rtl.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/rtl.html b/test/rtl.html index 07aa122..7a85f37 100644 --- a/test/rtl.html +++ b/test/rtl.html @@ -31,7 +31,7 @@ suite('rtl', function() { test('rightDrawer is true by default in RTL', function(done) { - expect(fixture('rtl-drawer').$$('paper-drawer-panel')).to.be.true; + expect(fixture('rtl-drawer').$$('paper-drawer-panel').rightDrawer).to.be.true; }); }); From 8383ddecec7eff0dae2cc278aab7827264792778 Mon Sep 17 00:00:00 2001 From: Dan Beam Date: Tue, 16 Feb 2016 17:37:25 -0800 Subject: [PATCH 3/9] fix tests? --- test/rtl.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/rtl.html b/test/rtl.html index 7a85f37..e80be96 100644 --- a/test/rtl.html +++ b/test/rtl.html @@ -31,7 +31,7 @@ suite('rtl', function() { test('rightDrawer is true by default in RTL', function(done) { - expect(fixture('rtl-drawer').$$('paper-drawer-panel').rightDrawer).to.be.true; + expect(fixture('rtl-drawer').rightDrawer).to.be.true; }); }); From 2af0381895749f6270fe359d23b436095437e0e2 Mon Sep 17 00:00:00 2001 From: Dan Beam Date: Tue, 16 Feb 2016 20:42:32 -0800 Subject: [PATCH 4/9] move to test/positioning.html and scope --- test/index.html | 2 -- test/positioning.html | 24 ++++++++++++++++++++---- test/rtl.html | 40 ---------------------------------------- 3 files changed, 20 insertions(+), 46 deletions(-) delete mode 100644 test/rtl.html diff --git a/test/index.html b/test/index.html index 09c150c..1509baa 100644 --- a/test/index.html +++ b/test/index.html @@ -19,10 +19,8 @@ diff --git a/test/positioning.html b/test/positioning.html index f70c2cf..0cfedc9 100644 --- a/test/positioning.html +++ b/test/positioning.html @@ -28,10 +28,10 @@ @@ -44,6 +44,15 @@ + + + + diff --git a/test/rtl.html b/test/rtl.html deleted file mode 100644 index e80be96..0000000 --- a/test/rtl.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - paper-drawer-panel tests - - - - - - - - - - - - - From 4f7513825bd3bda8364e88069c0677c46454ef0b Mon Sep 17 00:00:00 2001 From: Dan Beam Date: Thu, 18 Feb 2016 23:17:07 -0800 Subject: [PATCH 5/9] move to attached() --- paper-drawer-panel.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/paper-drawer-panel.html b/paper-drawer-panel.html index 730d130..1f358e1 100644 --- a/paper-drawer-panel.html +++ b/paper-drawer-panel.html @@ -468,10 +468,7 @@ * If true, position the drawer to the right. */ rightDrawer: { - type: Boolean, - value: function() { - return this._isRTL(); - }, + type: Boolean }, /** @@ -515,6 +512,10 @@ '_forceNarrowChanged(forceNarrow, defaultSelected)' ], + attached: function() { + this.rightDrawer = this._isRTL(); + }, + /** * Toggles the panel open and closed. * From ac4464147a3fc6a4d512262eea2a2bc6d31f06da Mon Sep 17 00:00:00 2001 From: Dan Beam Date: Thu, 18 Feb 2016 23:18:34 -0800 Subject: [PATCH 6/9] === --- paper-drawer-panel.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paper-drawer-panel.html b/paper-drawer-panel.html index 1f358e1..c606773 100644 --- a/paper-drawer-panel.html +++ b/paper-drawer-panel.html @@ -554,7 +554,7 @@ }, _isRTL: function() { - return window.getComputedStyle(this).direction == 'rtl'; + return window.getComputedStyle(this).direction === 'rtl'; }, _onMainTransitionEnd: function (e) { From ce94713923f29d4b4800911caaf599a5ed7f72af Mon Sep 17 00:00:00 2001 From: Dan Beam Date: Fri, 19 Feb 2016 11:52:59 -0800 Subject: [PATCH 7/9] remove Polymer.Base.async() call around RTL case --- test/positioning.html | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test/positioning.html b/test/positioning.html index 0cfedc9..7c21614 100644 --- a/test/positioning.html +++ b/test/positioning.html @@ -96,11 +96,8 @@ }); }); - test('rtl-drawer defaults rightDrawer to true', function(done) { - Polymer.Base.async(function() { - expect(fixture('rtl-drawer').rightDrawer).to.be.true; - done(); - }); + test('rtl-drawer defaults rightDrawer to true', function() { + expect(fixture('rtl-drawer').rightDrawer).to.be.true; }); }); From 02c8afb229e076424e204d3117d60b60d61b0c7d Mon Sep 17 00:00:00 2001 From: Dan Beam Date: Fri, 19 Feb 2016 15:31:19 -0800 Subject: [PATCH 8/9] allow setting rightDrawer before attached() to document --- paper-drawer-panel.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/paper-drawer-panel.html b/paper-drawer-panel.html index c606773..eb0126d 100644 --- a/paper-drawer-panel.html +++ b/paper-drawer-panel.html @@ -513,7 +513,8 @@ ], attached: function() { - this.rightDrawer = this._isRTL(); + if (this.rightDrawer === undefined) + this.rightDrawer = this._isRTL(); }, /** From f7366cc8e2ae2ab8eee5c1a6800c30e2d06f82d9 Mon Sep 17 00:00:00 2001 From: Dan Beam Date: Wed, 24 Feb 2016 13:45:22 -0800 Subject: [PATCH 9/9] notransition fix --- test/small-devices.html | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/test/small-devices.html b/test/small-devices.html index b3091cb..4639ef8 100644 --- a/test/small-devices.html +++ b/test/small-devices.html @@ -18,28 +18,25 @@ -