fixed title of tab for plugins

pull/1/head
LianaHus 6 years ago
parent 4c7f31cc11
commit fc31b3f332
  1. 11
      src/app/panels/tab-proxy.js
  2. 2
      src/app/ui/card.js

@ -27,7 +27,7 @@ export class TabProxy {
this._view.filetabs.activateTab(file)
return
}
this.addTab(file, () => {
this.addTab(file, "", () => {
this.fileManager.switchFile(file)
this.event.emit('switchFile', file)
},
@ -39,7 +39,7 @@ export class TabProxy {
fileManager.events.on('fileRenamed', (oldName, newName) => {
this.removeTab(oldName)
this.addTab(newName, () => {
this.addTab(newName, "", () => {
this.fileManager.switchFile(newName)
this.event.emit('switchFile', newName)
},
@ -54,6 +54,7 @@ export class TabProxy {
if (profile.location === 'mainPanel') {
this.addTab(
name,
profile.displayName,
() => this.event.emit('switchApp', name),
() => {
this.event.emit('closeApp', name)
@ -104,11 +105,13 @@ export class TabProxy {
this._view.filetabs.activateTab(name)
}
addTab (name, switchTo, close, kind) {
addTab (name, title, switchTo, close, kind) {
if (this._handlers[name]) return
var slash = name.split('/')
let title = name.indexOf('/') !== -1 ? slash[slash.length - 1] : name
if (!title) {
title = name.indexOf('/') !== -1 ? slash[slash.length - 1] : name
}
this._view.filetabs.addTab({
id: name,
title,

@ -16,7 +16,7 @@ module.exports = class Card {
if (self._view.el) return self._view.el
self._view.cardBody = yo`<div class=${css.cardBody}></div>`
self._view.arrow = yo`<i class="${css.arrow} fa fa-angle-down" onclick="${(e) => trigger(ev.target)}"></i>`
self._view.arrow = yo`<i class="${css.arrow} fa fa-angle-down" onclick="${() => trigger(this)}"></i>`
self._view.expandCollapseButton = yo`
<div class=${css.expandCollapseButton}>${self._view.arrow}</div>`

Loading…
Cancel
Save