Skip to content

Commit 5366042

Browse files
committed
fix: Standalone build & code structure refactoring
1 parent 3700b8e commit 5366042

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+125
-112
lines changed

dev/components/form/search.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77

88
<br><br>
99

10+
<div v-if="$quasar.platform.is.desktop">Desktop</div>
11+
<div v-else>Not desktop</div>
12+
13+
<div v-if="$quasar.theme === 'mat'">Mat</div>
14+
<div v-else>iOS</div>
15+
1016
<quasar-search v-model="search"></quasar-search>
1117
<quasar-search v-model="search" class="orange"></quasar-search>
1218
<quasar-search v-model="search" class="secondary" icon="explore" placeholder="Places"></quasar-search>

src/components/action-sheet/ActionSheet.vue

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
:content-css="css"
88
>
99
<!-- Material -->
10-
<div v-once v-if="theme === 'mat'">
10+
<div v-once v-if="$quasar.theme === 'mat'">
1111
<div v-if="title" class="modal-header" v-html="title"></div>
1212

1313
<div class="modal-scroll">
@@ -55,7 +55,7 @@
5555
</div>
5656

5757
<!-- iOS -->
58-
<div v-once v-if="theme === 'ios'">
58+
<div v-once v-if="$quasar.theme === 'ios'">
5959
<div class="quasar-action-sheet">
6060
<div v-if="title" class="modal-header" v-html="title"></div>
6161

@@ -106,7 +106,7 @@
106106
</template>
107107

108108
<script>
109-
import { current } from '../../theme'
109+
import { current as theme } from '../../features/theme'
110110
111111
const modalCSS = {
112112
mat: {
@@ -133,8 +133,7 @@ export default {
133133
},
134134
data () {
135135
return {
136-
theme: current,
137-
css: modalCSS[current]
136+
css: modalCSS[theme]
138137
}
139138
},
140139
computed: {

src/components/loading/loading.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { current as theme } from '../../theme'
2-
import { Vue } from '../../install'
3-
import Events from '../../events'
1+
import { current as theme } from '../../features/theme'
2+
import { Vue } from '../../vue-install'
3+
import Events from '../../features/events'
44
import Loading from './Loading.vue'
55

66
let

src/components/modal-generator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Vue } from '../install'
1+
import { Vue } from '../vue-install'
22

33
export default function (VueComponent) {
44
return {

src/components/toast/Toast.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
</template>
3434

3535
<script>
36-
import Events from '../../events'
36+
import Events from '../../features/events'
3737
import Utils from '../../utils'
3838
3939
let

src/theme.js renamed to src/features/addressbar-color.js

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
import Platform from './platform'
2-
import Utils from './utils'
2+
import Utils from '../utils'
33

4-
export function set (theme) {
5-
if (current) {
6-
document.body.classList.remove(current)
7-
}
8-
9-
current = theme
10-
document.body.classList.add(theme)
11-
12-
// add meta tag for mobile address bar coloring
13-
if (Platform.is.mobile && !Platform.is.cordova) {
4+
if (Platform.is.mobile && !Platform.is.cordova) {
5+
Utils.dom.ready(() => {
6+
// add meta tag for mobile address bar coloring
147
let tempDiv = document.createElement('div')
158
tempDiv.style.height = '10px'
169
tempDiv.style.position = 'absolute'
@@ -46,7 +39,5 @@ export function set (theme) {
4639
metaTag.setAttribute('content', hex)
4740

4841
document.getElementsByTagName('head')[0].appendChild(metaTag)
49-
}
42+
})
5043
}
51-
52-
export var current
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Events from './events'
2-
import Utils from './utils'
2+
import Utils from '../utils'
33

44
let
55
hidden = 'hidden',

src/features/body-classes.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import Platform from './platform'
2+
import Utils from '../utils'
3+
4+
function addClass (className) {
5+
document.body.classList.add(className)
6+
}
7+
8+
Utils.dom.ready(() => {
9+
addClass(Platform.is.desktop ? 'desktop' : 'mobile')
10+
addClass(Platform.has.touch ? 'touch' : 'no-touch')
11+
12+
if (Platform.within.iframe) {
13+
addClass('within-iframe')
14+
}
15+
16+
if (Platform.is.cordova) {
17+
addClass('cordova')
18+
}
19+
})

src/cookies.js renamed to src/features/cookies.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Utils from './utils'
1+
import Utils from '../utils'
22

33
function encode (string) {
44
return encodeURIComponent(string)

0 commit comments

Comments
 (0)