mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-27 06:23:41 -04:00
Resolves an issue with nanoscroller and initially hidden content
This commit is contained in:
parent
241adafad8
commit
55569ccf2f
4 changed files with 3 additions and 9 deletions
app/views
|
@ -113,6 +113,7 @@ module.exports = class EditorLevelView extends View
|
|||
button.find('> span').toggleClass('secret')
|
||||
|
||||
toggleTab: (e) ->
|
||||
@renderScrollbar()
|
||||
return unless $(document).width() <= 800
|
||||
li = $(e.target).closest('li')
|
||||
if li.hasClass('active')
|
||||
|
|
|
@ -114,10 +114,6 @@ module.exports = class ThangsTabView extends View
|
|||
@addThangsView = @insertSubView new AddThangsView world: @world, supermodel: @supermodel
|
||||
@buildInterface() # refactor to not have this trigger when this view re-renders?
|
||||
|
||||
renderScrollbar: ->
|
||||
@$el.find('.nano').nanoScroller()
|
||||
@$el.find('.nano-pane').css({'display': 'block'})
|
||||
|
||||
onFilterExtantThangs: (e) ->
|
||||
@$el.find('#extant-thangs-filter button.active').button('toggle')
|
||||
button = $(e.target).closest('button')
|
||||
|
|
|
@ -118,7 +118,8 @@ module.exports = class CocoView extends Backbone.View
|
|||
@renderScrollbar()
|
||||
|
||||
renderScrollbar: ->
|
||||
@$el.find('.nano').nanoScroller()
|
||||
#Defer the call till the content actually gets rendered, nanoscroller requires content to be visible
|
||||
_.defer => @$el.find('.nano').nanoScroller()
|
||||
|
||||
updateProgress: (progress) ->
|
||||
@loadProgress.progress = progress if progress > @loadProgress.progress
|
||||
|
|
|
@ -35,10 +35,6 @@ module.exports = class RootView extends CocoView
|
|||
$el ?= @$el.find('.main-content-area')
|
||||
super($el)
|
||||
|
||||
renderScrollbar: ->
|
||||
$('.nano-pane').css('display','none')
|
||||
$ -> $('.nano').nanoScroller()
|
||||
|
||||
afterInsert: ->
|
||||
# force the browser to scroll to the hash
|
||||
# also messes with the browser history, so perhaps come up with a better solution
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue