Make history.go work

This commit is contained in:
Cheng Zhao 2015-05-11 16:44:01 +08:00
parent 2bb7497312
commit e817192df3
4 changed files with 14 additions and 2 deletions

View file

@ -94,7 +94,12 @@ class NavigationController
goToOffset: (offset) ->
return unless @canGoToOffset offset
@goToIndex @currentIndex + offset
pendingIndex = @currentIndex + offset
if @inPageIndex > -1 and pendingIndex >= @inPageIndex
@pendingIndex = pendingIndex
@webContents._goToOffset offset
else
@goToIndex pendingIndex
getActiveIndex: ->
if @pendingIndex is -1 then @currentIndex else @pendingIndex