From 25fd303258acc56b5cff31025bddf1dc24d0de98 Mon Sep 17 00:00:00 2001 From: Narciso Jaramillo Date: Wed, 4 Apr 2012 09:37:59 -0700 Subject: [PATCH] Made Editor.setInlineWidgetHeight() also take a widget instead of an ID --- src/editor/CSSInlineEditor.js | 2 +- src/editor/Editor.js | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/editor/CSSInlineEditor.js b/src/editor/CSSInlineEditor.js index 5a72f792bfd..7ba387429cc 100644 --- a/src/editor/CSSInlineEditor.js +++ b/src/editor/CSSInlineEditor.js @@ -257,7 +257,7 @@ define(function (require, exports, module) { this.parentClass.sizeInlineWidgetToContents.call(this, force); // Size the widget height to the max between the editor content and the related rules list var widgetHeight = Math.max(this.$relatedContainer.find(".related").height(), this.$editorsDiv.height()); - this.hostEditor.setInlineWidgetHeight(this.id, widgetHeight, true); + this.hostEditor.setInlineWidgetHeight(this, widgetHeight, true); // The related rules container size itself based on htmlContent which is set by setInlineWidgetHeight above. this._updateRelatedContainer(); diff --git a/src/editor/Editor.js b/src/editor/Editor.js index 4117fa7e7c7..68bdeaa57e7 100644 --- a/src/editor/Editor.js +++ b/src/editor/Editor.js @@ -740,13 +740,13 @@ define(function (require, exports, module) { }; /** - * Sets the height of the inline widget for this editor. The inline editor is identified by id. - * @param {!number} id - * @param {!height} height - * @param {boolean} ensureVisible + * Sets the height of an inline widget in this editor. + * @param {!InlineWidget} inlineWidget The widget whose height should be set. + * @param {!height} height The height of the widget. + * @param {boolean} ensureVisible Whether to scroll the entire widget into view. */ - Editor.prototype.setInlineWidgetHeight = function (id, height, ensureVisible) { - this._codeMirror.setInlineWidgetHeight(id, height, ensureVisible); + Editor.prototype.setInlineWidgetHeight = function (inlineWidget, height, ensureVisible) { + this._codeMirror.setInlineWidgetHeight(inlineWidget.id, height, ensureVisible); };