Skip to content

Commit

Permalink
perf[Screenfull]: refactor screenfull component
Browse files Browse the repository at this point in the history
  • Loading branch information
PanJiaChen committed Feb 13, 2019
1 parent a1d6ad3 commit 0fed69f
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"mockjs": "1.0.1-beta3",
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
"screenfull": "3.3.3",
"screenfull": "4.0.0",
"showdown": "1.8.6",
"sortablejs": "1.7.0",
"tui-editor": "1.2.7",
Expand Down
6 changes: 4 additions & 2 deletions src/components/Screenfull/index.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div>
<svg-icon class-name="screenfull-icon" icon-class="screenfull" @click="click" />
<svg-icon :icon-class="isFullscreen?'exit-fullscreen':'fullscreen'" @click="click" />
</div>
</template>

Expand All @@ -23,7 +23,9 @@ export default {
})
return false
}
screenfull.toggle()
screenfull.toggle().then(() => {
this.isFullscreen = screenfull.isFullscreen
})
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/icons/svg/exit-fullscreen.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
1 change: 0 additions & 1 deletion src/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ export default {
logOut: 'Log Out',
dashboard: 'Dashboard',
github: 'Github',
screenfull: 'Screenfull',
theme: 'Theme',
size: 'Global Size'
},
Expand Down
1 change: 0 additions & 1 deletion src/lang/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ export default {
logOut: 'Salir',
dashboard: 'Panel de control',
github: 'Github',
screenfull: 'Pantalla completa',
theme: 'Tema',
size: 'Tamaño global'
},
Expand Down
1 change: 0 additions & 1 deletion src/lang/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ export default {
logOut: '退出登录',
dashboard: '首页',
github: '项目地址',
screenfull: '全屏',
theme: '换肤',
size: '布局大小'
},
Expand Down
4 changes: 1 addition & 3 deletions src/views/layout/components/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@

<error-log class="errLog-container right-menu-item hover-effect"/>

<el-tooltip :content="$t('navbar.screenfull')" effect="dark" placement="bottom">
<screenfull class="right-menu-item hover-effect"/>
</el-tooltip>
<screenfull class="right-menu-item hover-effect"/>

<el-tooltip :content="$t('navbar.size')" effect="dark" placement="bottom">
<size-select class="right-menu-item hover-effect"/>
Expand Down

0 comments on commit 0fed69f

Please sign in to comment.