fix style error in side bar

This commit is contained in:
Jocs 2018-06-07 20:54:32 +08:00
parent a703501fe6
commit 68b0871e94
11 changed files with 1630 additions and 6486 deletions

8066
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -143,8 +143,8 @@
"del": "^3.0.0",
"devtron": "^1.4.0",
"electron": "^2.0.2",
"electron-builder": "^20.14.7",
"electron-debug": "^1.5.0",
"electron-builder": "^20.15.1",
"electron-debug": "^2.0.0",
"electron-devtools-installer": "^2.2.4",
"electron-updater": "^2.21.10",
"electron-window-state": "^4.1.1",
@ -182,8 +182,8 @@
"vue-loader": "^15.2.0",
"vue-style-loader": "^4.1.0",
"vue-template-compiler": "^2.5.16",
"webpack": "^4.8.3",
"webpack-cli": "^2.1.4",
"webpack": "^4.11.1",
"webpack-cli": "^3.0.3",
"webpack-dev-server": "^3.1.4",
"webpack-hot-middleware": "^2.22.2",
"webpack-merge": "^4.1.2"

View File

@ -193,23 +193,29 @@ export const punctuation = ['!', '"', '#', '$', '%', '&', "'", '(', ')', '*', '+
export const TABLE_TOOLS = [{
label: 'table',
title: 'Resize Table',
icon: 'icon-table'
}, {
label: 'left',
title: 'Align Left',
icon: 'icon-alignleft'
}, {
label: 'center',
title: 'Align Center',
icon: 'icon-aligncenter'
}, {
label: 'right',
title: 'Align Right',
icon: 'icon-alignright'
}, {
label: 'delete',
title: 'Delete Table',
icon: 'icon-del'
}]
export const HTML_TOOLS = [{
label: 'delete',
title: 'Delete HTML block',
icon: 'icon-del'
}]

View File

@ -14,6 +14,7 @@ const htmlBlock = ContentState => {
const svgBlock = this.createBlock('svg')
svgBlock.icon = tool.icon
toolBlock.label = tool.label
toolBlock.title = tool.title
this.appendChild(toolBlock, svgBlock)
this.appendChild(ul, toolBlock)
})

View File

@ -45,13 +45,14 @@ export default function renderContainerBlock (block, cursor, activeBlocks, match
}
}
if (block.type === 'li' && block.label) {
const { label } = block
const { label, title } = block
const { align } = activeBlocks[0]
if (align && block.label === align) {
selector += '.active'
}
Object.assign(data.dataset, { label })
Object.assign(data.attrs, { title })
}
if (block.type === 'li' && block.listItemType) {
switch (block.listItemType) {

View File

@ -87,7 +87,6 @@
}
},
created () {
console.log(this.$store)
const { dispatch } = this.$store
// store/index.js
dispatch('LINTEN_WIN_STATUS')

View File

@ -22,7 +22,7 @@
ref="renameInput"
@keydown.enter="rename"
>
<span v-else>{{folder.name}}</span>
<span v-else class="text-overflow">{{folder.name}}</span>
</div>
<div
class="folder-contents"
@ -131,6 +131,7 @@
height: 30px;
padding-right: 15px;
& > svg {
flex-shrink: 0;
color: darkgray;
margin-right: 5px;
}

View File

@ -4,6 +4,7 @@
<a
href="javascript:;"
:class="{'active': active === 'tree'}"
title="Tree View"
>
<svg class="icon" aria-hidden="true" @click="active = 'tree'">
<use xlink:href="#icon-tree"></use>
@ -12,6 +13,7 @@
<a
href="javascript:;"
:class="{'active': active === 'list'}"
title="List View"
>
<svg class="icon" aria-hidden="true" @click="active = 'list'">
<use xlink:href="#icon-list"></use>
@ -24,13 +26,13 @@
<svg class="icon" aria-hidden="true">
<use xlink:href="#icon-arrow"></use>
</svg>
<span>Opened files</span>
<a href="javascript:;" @click.stop="saveAll(false)">
<span class="text-overflow">Opened files</span>
<a href="javascript:;" @click.stop="saveAll(false)" title="Save All">
<svg class="icon" aria-hidden="true">
<use xlink:href="#icon-save-all"></use>
</svg>
</a>
<a href="javascript:;" @click.stop="saveAll(true)">
<a href="javascript:;" @click.stop="saveAll(true)" title="Close All">
<svg class="icon" aria-hidden="true">
<use xlink:href="#icon-close-all"></use>
</svg>
@ -52,7 +54,7 @@
<svg class="icon" aria-hidden="true">
<use xlink:href="#icon-arrow"></use>
</svg>
<span>{{ projectTree.name }}</span>
<span class="text-overflow">{{ projectTree.name }}</span>
</div>
<div class="tree-wrapper" v-show="active === 'tree'">
<folder
@ -258,6 +260,10 @@
.project-tree {
display: flex;
flex-direction: column;
& > .title {
display: flex;
align-items: center;
}
& > .tree-wrapper,
& > .list-wrapper {
overflow: auto;

View File

@ -10,6 +10,13 @@
fill: currentColor;
overflow: hidden;
}
.text-overflow {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
@media print {
html, body {
background: #fff !important;

View File

@ -32,8 +32,7 @@ const actions = {
commit('SET_AI_STATUS', false)
return { data, total }
})
.catch(err => {
console.log(err)
.catch(() => {
commit('SET_AI_STATUS', false)
})
}

View File

@ -14,7 +14,6 @@ const state = {
const getters = {
toc: state => {
const { currentFile } = state
console.log(toc(currentFile.markdown).json)
return toc(currentFile.markdown).json
}
}
@ -201,16 +200,13 @@ const actions = {
LISTEN_FOR_SAVE_CLOSE ({ commit, state }) {
ipcRenderer.on('AGANI::save-all-response', (e, { err, data }) => {
if (err) {
console.log(err)
} else if (Array.isArray(data)) {
const toBeClosedTabs = [...state.tabs.filter(f => f.isSaved), ...data]
commit('CLOSE_TABS', toBeClosedTabs)
}
})
ipcRenderer.on('AGANI::save-single-response', (e, { err, data }) => {
console.log(data)
if (err) {
console.log(err)
} else if (Array.isArray(data) && data.length) {
commit('CLOSE_TABS', data)
}