Skip to content

Commit ec6160c

Browse files
committed
feat: Plugins enhancements
1 parent b457b18 commit ec6160c

File tree

6 files changed

+22
-1
lines changed

6 files changed

+22
-1
lines changed

src/install.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export default function (_Vue, opts = {}) {
5050
})
5151
}
5252
if (opts.plugins) {
53+
Platform.install({ Quasar })
5354
Object.keys(opts.plugins).forEach(key => {
5455
const p = opts.plugins[key]
5556
if (typeof p.install === 'function') {

src/plugins/app-fullscreen.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ export default {
2323
}
2424
},
2525

26+
__installed: false,
2627
install ({ Quasar, Vue }) {
28+
if (this.__installed) { return }
29+
this.__installed = true
30+
2731
const request = [
2832
'requestFullscreen',
2933
'msRequestFullscreen', 'mozRequestFullScreen', 'webkitRequestFullscreen'

src/plugins/app-visibility.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
export default {
33
isVisible: null,
44

5+
__installed: false,
56
install ({ Quasar, Vue }) {
7+
if (this.__installed) { return }
8+
this.__installed = true
9+
610
let prop, evt
711

812
if (typeof document.hidden !== 'undefined') { // Opera 12.10 and Firefox 18 and later support

src/plugins/cookies.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,11 @@ export default {
9696
remove,
9797
all: () => get(),
9898

99+
__installed: false,
99100
install ({ Quasar }) {
101+
if (this.__installed) { return }
102+
this.__installed = true
103+
100104
Quasar.cookies = this
101105
}
102106
}

src/plugins/platform.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,11 @@ const Platform = {
168168
iframe: window.self !== window.top
169169
},
170170

171+
__installed: false,
171172
install ({ Quasar }) {
173+
if (this.__installed) { return }
174+
this.__installed = true
175+
172176
Quasar.platform = Platform
173177
}
174178
}

src/plugins/web-storage.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,12 @@ export const SessionStorage = {
178178
}
179179

180180
export default {
181+
__installed: false,
181182
install ({ Quasar }) {
183+
if (this.__installed) { return }
184+
this.__installed = true
185+
182186
Quasar.sessionStorage = SessionStorage
183-
Quasar.localStorage = localStorage
187+
Quasar.localStorage = LocalStorage
184188
}
185189
}

0 commit comments

Comments
 (0)