From 5bad160184a2a60d5797a1ab16648bae15072f6b Mon Sep 17 00:00:00 2001 From: Peter Flynn Date: Tue, 17 Jul 2012 00:08:20 -0700 Subject: [PATCH] Fix issue #1240 (Inline editor background doesn't extend all the way to right when scrolling) - CodeMirror changed the way it props its width open such that lineSpace's width is no longer explicitly set to the max width of all the lines (lines wider than the viewport simply overflow it). We were checking this width to decide how wide inline editors must be. However, lineSpace's _content_ is still as wide as the max line (due to the pos of the new widthForcer div) so we can use lineSpace's scrollWidth and still get an accurate number. --- src/editor/MultiRangeInlineEditor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/editor/MultiRangeInlineEditor.js b/src/editor/MultiRangeInlineEditor.js index 4f96dbe0565..2c7bc58de4f 100644 --- a/src/editor/MultiRangeInlineEditor.js +++ b/src/editor/MultiRangeInlineEditor.js @@ -386,7 +386,7 @@ define(function (require, exports, module) { // growing the overall width. // This is a bit of a hack since it relies on knowing some detail about the innards of CodeMirror. var lineSpace = this.hostEditor._getLineSpaceElement(), - minWidth = $(lineSpace).offset().left - this.$htmlContent.offset().left + $(lineSpace).width(); + minWidth = $(lineSpace).offset().left - this.$htmlContent.offset().left + lineSpace.scrollWidth; this.$htmlContent.css("min-width", minWidth + "px"); };