Skip to content

Commit

Permalink
Move code to initBodyClass (vuejs#554)
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Chau authored Jan 24, 2018
1 parent 2df8065 commit 0f2468a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/devtools/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Object.defineProperties(Vue.prototype, {
'$keys': { get: () => keys }
})

if (isWindows) document.body.classList.add('platform-windows')
if (isMac) document.body.classList.add('platform-mac')
if (isLinux) document.body.classList.add('platform-linux')
export function initBodyClass () {
if (isWindows) document.body.classList.add('platform-windows')
if (isMac) document.body.classList.add('platform-mac')
if (isLinux) document.body.classList.add('platform-linux')
}
9 changes: 8 additions & 1 deletion src/devtools/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import App from './App.vue'
import store from './store'
import './plugins'
import { parse } from '../util'
import { isChrome } from './env'
import { isChrome, initBodyClass } from './env'

// UI

Expand Down Expand Up @@ -134,10 +134,13 @@ function initApp (shell) {

app = new Vue({
extends: App,

store,

data: {
isDark
},

watch: {
isDark: {
handler (value) {
Expand All @@ -149,6 +152,10 @@ function initApp (shell) {
},
immediate: true
}
},

mounted () {
initBodyClass()
}
}).$mount('#app')

Expand Down

0 comments on commit 0f2468a

Please sign in to comment.