Commit 3f1ba2db authored by Benjamin Fischer's avatar Benjamin Fischer
Browse files

FileManager: set tab-label to current path

parent 2ab4fc29
......@@ -7,26 +7,23 @@ define([
path: this.prefs.get("homePath"),
}, args);
this.state.on("path", function() {
this.state.on("path", function(path) {
if (!this.vue) return;
if (!this.vue.content) return;
if (this.autoPathLabel)
this.setLabel(path, true);
this.reload();
}.bind(this));
this.socket.on("watch", function(data) {
// console.log(data);
if (data.event != "change") return;
this.reload();
// The following two parameters are defined in remote/filesystem.py
// MAX_INLINE_SUBJECTS = 10
// MAX_SUBJECT_NAMES = 25
// if (data.subject_count <= 10) {
// self.fb.view.reactOnChange(data);
// } else {
// self.fb.updateView();
// }
// TODO: handle inline diffs
}.bind(this));
if (this.autoPathLabel)
this.setLabel(this.state.get("path"), true);
this.prefs.forceWorkspace("bookmarks");
},
navigate: function(path) {
......
......@@ -20,9 +20,8 @@ define([
var FileMainView = MainView._extend($.extend({}, BaseMixin, {
init: function init(args) {
init._super.apply(this, arguments);
this.autoPathLabel = true;
BaseMixin.init.call(this, args);
this.prefs.forceWorkspace("bookmarks");
},
getFragment: function() {
......
......@@ -64,18 +64,11 @@ define([
var FileSelectorView = DialogView._extend($.extend({}, BaseMixin, {
init: function init(args) {
init._super.apply(this, arguments);
BaseMixin.init.call(this, args);
this.prefs.forceWorkspace("bookmarks");
this._args = args;
if (args.label === undefined)
this.label = args.label;
else
this.state.on("path", function(path) {
this.label = path;
}.bind(this));
this.autoPathLabel = true;
BaseMixin.init.call(this, args);
},
render: function() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment