session: use basename in window title

This commit is contained in:
jean-emmanuel 2019-04-02 10:35:33 +02:00
parent f841b9b56d
commit 283f9074bc
3 changed files with 10 additions and 6 deletions

View file

@ -10,7 +10,8 @@ var utils = require('../ui/utils'),
notifications = require('../ui/notifications'),
{TRAVERSING_SAMEWIDGET} = require('../events/utils'),
raw = require('nanohtml/raw'),
ipc = require('./')
ipc = require('./'),
windowTitle = document.title
module.exports = {
@ -196,6 +197,12 @@ module.exports = {
message: message
})
},
setTitle: function(data) {
document.title = windowTitle + (data ? ' (' + data + ')' : '')
}
}

View file

@ -18,8 +18,6 @@ var SessionManager = class SessionManager {
this.lock = false
this.setSessionPath('')
this.windowTitle = document.title
ipc.on('connect', ()=>{
ipc.send('sessionSetPath', {path: this.sessionPath})
})
@ -244,9 +242,6 @@ var SessionManager = class SessionManager {
setSessionPath(path) {
this.sessionPath = path
if (path) {
document.title = this.windowTitle + ' (' + path + ')'
}
}

View file

@ -74,6 +74,8 @@ module.exports = {
ipc.clients[clientId].sessionPath = data.path
ipc.send('setTitle', path.basename(data.path), clientId)
},
sessionOpen: function(data,clientId) {