diff --git a/src/editor/CSSInlineEditor.js b/src/editor/CSSInlineEditor.js index 7ba387429cc..2673e2cc745 100644 --- a/src/editor/CSSInlineEditor.js +++ b/src/editor/CSSInlineEditor.js @@ -182,10 +182,10 @@ define(function (require, exports, module) { }; /** - * Called any time inline was closed, whether manually (via closeThisInline()) or automatically + * Called any time inline is closed, whether manually (via closeThisInline()) or automatically */ - CSSInlineEditor.prototype.onClosed = function () { - this.parentClass.onClosed.call(this); // super.onClosed() + CSSInlineEditor.prototype.close = function () { + this.parentClass.close.call(this); // super.close() // remove resize handlers for relatedContainer $(this.hostEditor).off("change", this._updateRelatedContainer); diff --git a/src/editor/Editor.js b/src/editor/Editor.js index 68bdeaa57e7..26a6ad3bf6c 100644 --- a/src/editor/Editor.js +++ b/src/editor/Editor.js @@ -347,7 +347,7 @@ define(function (require, exports, module) { // Destroying us destroys any inline widgets we're hosting. Make sure their closeCallbacks // run, at least, since they may also need to release Document refs this._inlineWidgets.forEach(function (inlineWidget) { - inlineWidget.onClosed(); + inlineWidget.close(); }); }; @@ -699,12 +699,10 @@ define(function (require, exports, module) { var self = this; inlineWidget.id = this._codeMirror.addInlineWidget(pos, inlineWidget.htmlContent, inlineWidget.height, function (id) { self._removeInlineWidgetInternal(id); - inlineWidget.onClosed(); + inlineWidget.close(); }); this._inlineWidgets.push(inlineWidget); inlineWidget.onAdded(); - - return inlineWidget.id; }; /** diff --git a/src/editor/EditorManager.js b/src/editor/EditorManager.js index c868449d00c..e9b8f42594d 100644 --- a/src/editor/EditorManager.js +++ b/src/editor/EditorManager.js @@ -143,10 +143,10 @@ define(function (require, exports, module) { } /** - * Removes the given widget UI from the given hostEdtior (agnostic of what the widget's content - * is). The widget's onClosed() callback will be run as a result. - * @param {!Editor} hostEditor - * @param {!number} inlineId + * Removes the given widget UI from the given hostEditor (agnostic of what the widget's content + * is). The widget's close() method will be run as a result. + * @param {!Editor} hostEditor The editor containing the widget. + * @param {!InlineWidget} inlineWidget The inline widget to close. * @param {!boolean} moveFocus If true, focuses hostEditor and ensures the cursor position lies * near the inline's location. */ @@ -164,9 +164,7 @@ define(function (require, exports, module) { } hostEditor.removeInlineWidget(inlineWidget); - } - /** * Registers a new inline provider. When _openInlineWidget() is called each registered inline diff --git a/src/editor/InlineTextEditor.js b/src/editor/InlineTextEditor.js index 0984c0f5e2d..67ac0d81181 100644 --- a/src/editor/InlineTextEditor.js +++ b/src/editor/InlineTextEditor.js @@ -109,7 +109,7 @@ define(function (require, exports, module) { /** * Called any time inline was closed, whether manually (via close()) or automatically */ - InlineTextEditor.prototype.onClosed = function () { + InlineTextEditor.prototype.close = function () { _syncGutterWidths(this.hostEditor); this.editors.forEach(function (editor) { @@ -258,7 +258,7 @@ define(function (require, exports, module) { InlineTextEditor.prototype.close = function () { var shouldMoveFocus = this._editorHasFocus(); EditorManager.closeInlineWidget(this.hostEditor, this, shouldMoveFocus); - // closeInlineWidget() causes our onClosed() to get run + // closeInlineWidget() causes our close() to be called }; diff --git a/src/editor/InlineWidget.js b/src/editor/InlineWidget.js index cf79762b99b..6cd14a40077 100644 --- a/src/editor/InlineWidget.js +++ b/src/editor/InlineWidget.js @@ -28,9 +28,9 @@ define(function (require, exports, module) { InlineWidget.prototype.hostEditor = null; /** - * Called any time inline was closed, whether manually (via close()) or automatically + * Called any time inline is closed, whether manually or automatically */ - InlineWidget.prototype.onClosed = function () { + InlineWidget.prototype.close = function () { // do nothing - base implementation };