Skip to content

Commit

Permalink
Don't force scroll when reloading iframe.
Browse files Browse the repository at this point in the history
  • Loading branch information
gruehle committed Jan 29, 2015
1 parent 88fa7f6 commit c2b8c6a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,17 @@ define(function (require, exports, module) {
});
$iframe.attr("srcdoc", htmlSource);

// Remove any existing load handlers
$iframe.off("load");
$iframe.load(function () {
// Open external browser when links are clicked
// (similar to what brackets.js does - but attached to the iframe's document)
$iframe[0].contentDocument.body.addEventListener("click", _handleLinkClick, true);

// Sync scroll position (if needed)
_editorScroll();
if (!preserveScrollPos) {
_editorScroll();
}

// Make sure iframe is showing
$iframe.show();
Expand Down

0 comments on commit c2b8c6a

Please sign in to comment.