Skip to content

Commit

Permalink
fix elastic#807: do not scroll modals to top
Browse files Browse the repository at this point in the history
  • Loading branch information
Raz0r committed Aug 13, 2014
1 parent 23cd70f commit 6d38501
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app/directives/configModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,16 @@ function (angular,_) {
scope: tmpScope,
keyboard: false
});

var x = window.scrollX, y = window.scrollY;

// and show it
$q.when(panelModal).then(function(modalEl) {
modalEl.modal('show');
modalEl.bind('shown', function(){
modalEl.attr('style', function(i, s) { return s + 'top: ' + y + 'px !important'});
window.scrollTo(x, y);
});
});
scope.$apply();
});
Expand Down

0 comments on commit 6d38501

Please sign in to comment.