Commit 01f79759 authored by ThorbenQuast's avatar ThorbenQuast
Browse files

editor: add tooltip to save button (when disabled)

parent d76261e2
......@@ -202,7 +202,6 @@ var CodeEditor = Emitter.extend({
},
checkModifications: function() {
clearTimeout(this.keyupMinTimeout);
clearTimeout(this.keyupMaxTimeout);
this.keyupMinTimeout = null;
......@@ -212,11 +211,31 @@ var CodeEditor = Emitter.extend({
if (isModified != this.view.isModified()) {
this.view.setModified(isModified);
}
this.view.toggleMenuEntry("save", isModified && this.path && this.writable);
this.toggleSaveButton(isModified, this.path, this.writable);
return this;
},
toggleSaveButton: function(isModified, hasPath, writable) {
this.view.toggleMenuEntry("save", isModified && hasPath && writable);
var btn = this.view._getFastMenuEntryNode("save");
if (btn){
var msg = "";
if (!(isModified && hasPath && writable)){
msg = "Saving disabled:";
if (!isModified)
msg = msg + "\n - file unmodified";
if (!hasPath)
msg = msg + "\n - path to file does not exist";
if (!writable)
msg = msg + "\n - no writing permission";
}
btn.attr("title", msg);
}
return this
},
addComment: function() {
//only possible if path is set
if (!this.path)
......
Markdown is supported
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