Bug 892275 - F2 should make the selected node and its children editable as html; r=mratcliffe

This commit is contained in:
Brian Grinstead
2013-11-07 10:23:25 -06:00
parent 26b7c46962
commit 4eca5b7553
5 changed files with 185 additions and 66 deletions

View File

@@ -60,6 +60,7 @@ function HTMLEditor(htmlDocument)
};
config.extraKeys[ctrl("Enter")] = this.hide;
config.extraKeys["F2"] = this.hide;
config.extraKeys["Esc"] = this.hide.bind(this, false);
this.container.addEventListener("click", this.hide, false);
@@ -140,6 +141,8 @@ HTMLEditor.prototype = {
this.editor.refresh();
this.editor.focus();
this.emit("popupshown");
},
/**
@@ -161,9 +164,9 @@ HTMLEditor.prototype = {
let newValue = this.editor.getText();
let valueHasChanged = this._originalValue !== newValue;
let preventCommit = shouldCommit === false || !valueHasChanged;
this.emit("popup-hidden", !preventCommit, newValue);
this._originalValue = undefined;
this._visible = undefined;
this.emit("popuphidden", !preventCommit, newValue);
},
/**