From 542b69b6b8629ae9e55009acae0ebb394b73e508 Mon Sep 17 00:00:00 2001 From: Petr Zdarsky Date: Wed, 15 Apr 2015 10:19:24 +0200 Subject: [PATCH 1/2] Optional overlay Now the overlay of the screen is optional when the menu is opened. --- paper-fab-menu.html | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/paper-fab-menu.html b/paper-fab-menu.html index 5f977cb..178cda0 100755 --- a/paper-fab-menu.html +++ b/paper-fab-menu.html @@ -32,7 +32,7 @@ @homepage http://cwdoh.github.io/paper-fab-menu --> - + - +
@@ -125,6 +127,14 @@ * @default 10000 */ zIndex: 10000, + + /** + * Set if the overlay of screen should be used when the menu is opened. + * @attribute overlay + * @type boolean + * @default false + */ + overlay: false, ready: function() { this.calculateTransitionEffects.apply(this); From 6b9a0a537d4d2f68e69fc3384887f499aaac85d8 Mon Sep 17 00:00:00 2001 From: Petr Zdarsky Date: Wed, 15 Apr 2015 10:56:40 +0200 Subject: [PATCH 2/2] Bug fixes --- paper-fab-menu.html | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/paper-fab-menu.html b/paper-fab-menu.html index 178cda0..5b6266d 100755 --- a/paper-fab-menu.html +++ b/paper-fab-menu.html @@ -144,7 +144,9 @@ }, overlayOpenedChanged: function() { - this.opened = this.$.overlay.opened; + if(this.overlay){ + this.opened = this.$.overlay.opened; + } }, /** @@ -167,16 +169,20 @@ return; for (l in backdrops) { - if (backdrops[l] != this.$.overlay.scrim) { - // add core-opened to other backdrop for workaround - backdrops[l].classList.add('core-opened') - - // remove overlay of fab-menu. - this.$.overlay.scrim.remove(); - - // just do this at first backdrop. - return; - } + if(this.overlay) { + if (backdrops[l] != this.$.overlay.scrim) { + // add core-opened to other backdrop for workaround + backdrops[l].classList.add('core-opened') + + // remove overlay of fab-menu. + + this.$.overlay.scrim.remove(); + + + // just do this at first backdrop. + return; + } + } } } @@ -200,8 +206,10 @@ this.opened = true; this.$.trigger.icon = this.closeIcon; this.$.trigger.setAttribute("activate", ""); - - this.$.overlay.open(); + + if(this.overlay){ + this.$.overlay.open(); + } }, /** @@ -214,7 +222,9 @@ this.$.trigger.icon = this.icon; this.$.trigger.removeAttribute("activate"); - this.$.overlay.close(); + if(this.overlay){ + this.$.overlay.close(); + } }, update: function() {