Skip to content

Commit

Permalink
更新[BoxJs TF]: 新增下拉显示&隐藏搜索栏, 优化固定背景, 修复搜索栏高度问题
Browse files Browse the repository at this point in the history
  • Loading branch information
chavyleung committed Aug 19, 2020
1 parent 87ac7ce commit 6b46dbb
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 6 deletions.
22 changes: 17 additions & 5 deletions box/chavy.boxjs.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
@click="box.usercfgs.isHidedSearchBar = false"
v-if="box.usercfgs.isHidedSearchBar"
></v-system-bar>
<v-app-bar v-bind="appBarBind" v-if="!box.usercfgs.isHidedSearchBar">
<v-app-bar v-bind="appBarBind" v-show="!box.usercfgs.isHidedSearchBar">
<!-- 搜索条 -->
<v-autocomplete v-bind="ui.searchBar" :label="title" @click="ui.searchDialog.show = true" hide-no-data hide-details solo>
<template #prepend-inner>
Expand Down Expand Up @@ -1144,7 +1144,7 @@ <h2>{{curbak.name}}</h2>
<v-btn dark v-if="!box.usercfgs.isHideRefresh" fab small color="orange" @click="window.location.reload()">
<v-icon>mdi-refresh</v-icon>
</v-btn>
<v-btn dark v-if="!box.usercfgs.isHideCoding" fab small @click="path = '/coding'">
<v-btn dark v-if="!box.usercfgs.isHideCoding" fab small @click="path = '/#/coding'">
<v-icon>mdi-code-tags</v-icon>
</v-btn>
<v-btn dark v-if="!box.usercfgs.isHidedSearch" fab small color="green" @click="ui.searchDialog.show = true">
Expand Down Expand Up @@ -1216,7 +1216,7 @@ <h2 :class="version === ver.version ? 'primary--text' : undefined">v{{ver.versio
scrollY: {}, //记录每个界面的滚动值
overlay: { show: false, val: 60 },
snackbar: { show: false, color: 'primary', msg: '' },
searchBar: { color: 'primary', readonly: true, input: '' },
searchBar: { color: 'primary', readonly: true, input: '', hideNoData: true, hideDetails: true, solo: true },
searchDialog: { show: false },
versionsheet: { show: false },
updatesheet: { show: false },
Expand Down Expand Up @@ -1399,14 +1399,14 @@ <h2 :class="version === ver.version ? 'primary--text' : undefined">v{{ver.versio
}
},
appBarBind() {
let app = !!this.box.usercfgs.isPinedSearchBar
let app = !!this.box.usercfgs.isPinedSearchBar && !this.box.usercfgs.isHidedSearchBar
let color = 'transparent'
const isEmptyLight = this.isWebApp && !this.isDarkMode && !this.isWallpaper
if (isEmptyLight) {
color = 'primary'
}
let flat = color === 'transparent'
return { app, color, flat, height: '68' }
return { app, color, flat, height: '68', maxHeight: '68' }
},
searchBarBind() {
const color = this.isDarkMode ? null : 'primary'
Expand Down Expand Up @@ -1720,8 +1720,20 @@ <h2 :class="version === ver.version ? 'primary--text' : undefined">v{{ver.versio
methods: {
// 记录每个页面的滚动值
onScroll(event) {
const currentY = event.currentTarget.scrollY
const historyY = this.ui.scrollY[this.path]
this.ui.scrollY[this.path] = event.currentTarget.scrollY
// 下拉显示/隐藏顶栏
// 回弹时才触发显示与隐藏, 1 秒内不重复触发
if (currentY < historyY && currentY < -30 && !this.ui.isWaitToggleSearchBar) {
this.ui.isWaitToggleSearchBar = true
this.box.usercfgs.isHidedSearchBar = !this.box.usercfgs.isHidedSearchBar
this.toggleWaitSearchBar()
}
},
toggleWaitSearchBar: _.debounce(function () {
this.ui.isWaitToggleSearchBar = false
}, 1000),
handleHistory(path) {
const state = { title: 'BoxJs', url: path }
if (!history.state) {
Expand Down
2 changes: 1 addition & 1 deletion box/chavy.boxjs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const $ = new Env('BoxJs')

$.version = '0.7.35'
$.version = '0.7.36'
$.versionType = 'beta'

/**
Expand Down
21 changes: 21 additions & 0 deletions box/release/box.release.tf.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
{
"releases": [
{
"version": "0.7.36",
"tags": ["beta"],
"author": "@chavyleung",
"icon": "https://avatars3.githubusercontent.com/u/29748519",
"repo": "https://github.com/chavyleung",
"notes": [
{
"name": "新增",
"descs": ["下拉显示&隐藏搜索栏"]
},
{
"name": "优化",
"descs": ["固定背景"]
},
{
"name": "修复",
"descs": ["搜索栏高度问题"]
}
]
},
{
"version": "0.7.35",
"tags": ["beta"],
Expand Down

0 comments on commit 6b46dbb

Please sign in to comment.