File tree Expand file tree Collapse file tree 5 files changed +30
-37
lines changed
Expand file tree Collapse file tree 5 files changed +30
-37
lines changed Original file line number Diff line number Diff line change @@ -26,13 +26,16 @@ export default function (_Vue, opts = {}) {
2626 this . installed = true
2727
2828 setVue ( _Vue )
29- ready ( addBodyClasses )
3029
3130 const Quasar = {
3231 version,
3332 theme : __THEME__
3433 }
3534
35+ // required plugin
36+ Platform . install ( { Quasar } )
37+ ready ( addBodyClasses )
38+
3639 if ( opts . directives ) {
3740 Object . keys ( opts . directives ) . forEach ( key => {
3841 const d = opts . directives [ key ]
@@ -50,9 +53,6 @@ export default function (_Vue, opts = {}) {
5053 } )
5154 }
5255 if ( opts . plugins ) {
53- // required plugin
54- Platform . install ( { Quasar } )
55-
5656 Object . keys ( opts . plugins ) . forEach ( key => {
5757 const p = opts . plugins [ key ]
5858 if ( typeof p . install === 'function' ) {
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import AddressbarColor from './plugins/addressbar-color'
22import AppFullscreen from './plugins/app-fullscreen'
33import AppVisibility from './plugins/app-visibility'
44import Cookies from './plugins/cookies'
5- import Cordova from './plugins/cordova'
65import Platform from './plugins/platform'
76import { LocalStorage , SessionStorage } from './plugins/web-storage'
87
@@ -11,7 +10,6 @@ export {
1110 AppFullscreen ,
1211 AppVisibility ,
1312 Cookies ,
14- Cordova ,
1513 Platform ,
1614 LocalStorage ,
1715 SessionStorage
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -164,19 +164,19 @@ function getPlatform () {
164164}
165165
166166const Platform = {
167- is : getPlatform ( ) ,
168- has : {
169- touch : ( ( ) => ! ! ( 'ontouchstart' in document . documentElement ) || window . navigator . msMaxTouchPoints > 0 ) ( )
170- } ,
171- within : {
172- iframe : window . self !== window . top
173- } ,
174-
175167 __installed : false ,
176168 install ( { Quasar } ) {
177169 if ( this . __installed ) { return }
178170 this . __installed = true
179171
172+ Platform . is = getPlatform ( )
173+ Platform . has = {
174+ touch : ( ( ) => ! ! ( 'ontouchstart' in document . documentElement ) || window . navigator . msMaxTouchPoints > 0 ) ( )
175+ }
176+ Platform . within = {
177+ iframe : window . self !== window . top
178+ }
179+
180180 Quasar . platform = Platform
181181 }
182182}
Original file line number Diff line number Diff line change @@ -2,24 +2,31 @@ import Platform from '../plugins/platform'
22
33let handlers = [ ]
44
5- if ( Platform . is . desktop ) {
6- window . addEventListener ( 'keyup' , evt => {
7- if ( handlers . length === 0 ) {
8- return
9- }
5+ export default {
6+ __installed : false ,
7+ __install ( ) {
8+ this . __installed = true
9+ window . addEventListener ( 'keyup' , evt => {
10+ if ( handlers . length === 0 ) {
11+ return
12+ }
1013
11- if ( evt . which === 27 || evt . keyCode === 27 ) {
12- handlers [ handlers . length - 1 ] ( )
13- }
14- } )
15- }
14+ if ( evt . which === 27 || evt . keyCode === 27 ) {
15+ handlers [ handlers . length - 1 ] ( )
16+ }
17+ } )
18+ } ,
1619
17- export default {
1820 register ( handler ) {
1921 if ( Platform . is . desktop ) {
22+ if ( ! this . __installed ) {
23+ this . __install ( )
24+ }
25+
2026 handlers . push ( handler )
2127 }
2228 } ,
29+
2330 pop ( ) {
2431 if ( Platform . is . desktop ) {
2532 handlers . pop ( )
You can’t perform that action at this time.
0 commit comments