Skip to content
This repository was archived by the owner on Mar 14, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions src/js/composer.js
Original file line number Diff line number Diff line change
Expand Up @@ -804,13 +804,6 @@ $(function() {
$(inputs).disableSelection();
});

$('div:jqmData(role="page")').live('pageshow', function(e) {
// Make sure selected node is visible on pageinit
$('.ui-selected:first').each(function () {
$.mobile.silentScroll($(this).offset().top);
});
});

function messageHandler(e) {
switch (e.data) {
case 'reload':
Expand Down
8 changes: 7 additions & 1 deletion src/js/views/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,8 @@
},

_modelUpdatedHandler: function (event, widget) {
var win, aPage, pageNode;
var win, aPage, pageNode,
oldScrollTop = (widget.options.contentDocument.scrollTop());

widget = widget || this;

Expand All @@ -283,6 +284,11 @@
} else {
console.error(widget.widgetName, ':: Missing contentDocument');
}
widget.options.contentDocument.scrollTop(oldScrollTop);
// Make sure Make sure selected node is visible
widget.options.contentDocument.find('.ui-selected').first().each(function () {
this.scrollIntoViewIfNeeded()
});
},

_createDocument: function () {
Expand Down