Skip to content

Commit

Permalink
More clever way of detecting scroll containers
Browse files Browse the repository at this point in the history
  • Loading branch information
yishn committed Sep 9, 2016
1 parent 8a7d85a commit 9b71d42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion view/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1754,7 +1754,8 @@ function sendGTPCommand(command, ignoreBlocked, callback) {
if (callback) callback(response)

// Update scrollbars
var $view = $('#console').hasClass('gm-prevented') ? $('#console') : $('#console .gm-scroll-view')

var $view = $('#console.gm-prevented, #console.gm-scrollbar-container .gm-scroll-view')
var scrollbar = $('#console').data('scrollbar')

$view.scrollTop($view.get(0).scrollHeight)
Expand Down
3 changes: 2 additions & 1 deletion view/index.view.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ function setShowLeftSidebar(show) {
setting.set('view.show_leftsidebar', show)

// Update scrollbars
var $view = $('#console').hasClass('gm-prevented') ? $('#console') : $('#console .gm-scroll-view')

var $view = $('#console.gm-prevented, #console.gm-scrollbar-container .gm-scroll-view')
$view.scrollTop($view.get(0).scrollHeight)
$view.find('form:last-child input').get(0).focus()
$('#console').data('scrollbar').update()
Expand Down

0 comments on commit 9b71d42

Please sign in to comment.