From ae1bb185ddd7a657a9395eeba1c425f7369990f2 Mon Sep 17 00:00:00 2001 From: yxwyoyoyo Date: Fri, 13 Dec 2019 15:40:25 +0800 Subject: [PATCH] FIX: add simple-stack-fullscreen class if el is data-stack-fullscreen when init --- lib/stack.js | 9 ++++++++- package-lock.json | 2 +- package.json | 2 +- src/stack.coffee | 3 +++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/stack.js b/lib/stack.js index e33aeb2..7d2e528 100644 --- a/lib/stack.js +++ b/lib/stack.js @@ -31,7 +31,8 @@ Stack = (function(superClass) { title: '{{ name }}', transition: true, slowTime: 800, - fluid: false + fluid: false, + fullscreen: false }; Stack.prototype.supportHistory = !!(window.history && history.pushState); @@ -47,10 +48,16 @@ Stack = (function(superClass) { if (this.el.is('[data-stack-fluid]')) { this.opts.fluid = true; } + if (this.el.is('[data-stack-fullscreen]')) { + this.opts.fullscreen = true; + } this.el.addClass('simple-stack'); if (this.opts.fluid) { this.el.addClass('simple-stack-fluid'); } + if (this.opts.fullscreen) { + this.el.addClass('simple-stack-fullscreen'); + } this.stack = []; this._initStack(); this.currentPage.loadPage(); diff --git a/package-lock.json b/package-lock.json index c8a0689..ac395c4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "simple-stack", - "version": "2.0.8", + "version": "2.0.9", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d299e87..8ab6d84 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "simple-stack", - "version": "2.0.8", + "version": "2.0.9", "description": "A stack layout component", "main": "lib/stack.js", "repository": { diff --git a/src/stack.coffee b/src/stack.coffee index f055e9a..40ca159 100644 --- a/src/stack.coffee +++ b/src/stack.coffee @@ -7,6 +7,7 @@ class Stack extends SimpleModule transition: true slowTime: 800 fluid: false + fullscreen: false supportHistory: !!(window.history && history.pushState) @@ -17,9 +18,11 @@ class Stack extends SimpleModule return unless @el.length > 0 @opts.fluid = true if @el.is '[data-stack-fluid]' + @opts.fullscreen = true if @el.is '[data-stack-fullscreen]' @el.addClass 'simple-stack' @el.addClass 'simple-stack-fluid' if @opts.fluid + @el.addClass 'simple-stack-fullscreen' if @opts.fullscreen @stack = [] @_initStack()