Skip to content

Commit

Permalink
Merge branch 'bugfix_package_10' into cutting-edge
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris K committed Oct 2, 2012
2 parents acdcbde + 3876165 commit d088a7a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/ecma-debugger/js-source-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,10 @@ cls.JsSourceView = function(id, name, container_class)

var setScriptContext = function(script_id, line_no)
{
source_content.innerHTML = "<div style='visibility:hidden'>" +
source_content.innerHTML = "<div style='visibility:hidden;float:left'>" +
simple_js_parser.format(__current_script, getMaxLengthLineIndex() - 1, 1).join('') + "</div>";
var scrollWidth = __current_script.scroll_width = document.getElementById(SCROLL_CONTENT_ID).scrollWidth;
var scroll_width_target = source_content.firstElementChild || document.getElementById(SCROLL_CONTENT_ID);
var scrollWidth = __current_script.scroll_width = scroll_width_target.scrollWidth;
var offsetWidth = document.getElementById(SCROLL_CONTENT_ID).offsetWidth;
// ensure that a scrollbar is also displayed with very long one-liner scripts
// max width which produces a scrollbar is 0x7FFF - 1
Expand All @@ -417,6 +418,14 @@ cls.JsSourceView = function(id, name, container_class)
{
__max_lines = __current_script.line_arr.length;
}

if (__current_script.line_arr.length > __max_lines &&
scrollWidth <= offsetWidth && offsetWidth - scrollWidth < context['scrollbar-width'])
{
__max_lines -= 1;
__current_script.scroll_width += context['scrollbar-width'];
}

var lines = document.querySelector(CONTAINER_LINE_NR_SELECTOR);

if (lines)
Expand Down

0 comments on commit d088a7a

Please sign in to comment.