Improve perf. by not showing/hiding waiting
This commit is contained in:
@@ -72,8 +72,9 @@ module.exports = class BaseController extends backbone.View
|
||||
|
||||
show: ($el)->
|
||||
$el ?= @$el
|
||||
$el.data 'target-visibility', 'visible'
|
||||
_.delay (=> @_adjustTargetVisibility $el), Duration.snap
|
||||
if $el.hasClass('hiding') or $el.hasClass('hidden')
|
||||
$el.data 'target-visibility', 'visible'
|
||||
_.delay (=> @_adjustTargetVisibility $el), Duration.snap
|
||||
|
||||
unrender: ->
|
||||
@undelegateEvents()
|
||||
|
||||
@@ -37,7 +37,7 @@ module.exports = class CraftsmanWorkingController extends BaseController
|
||||
_refreshStatusText: ->
|
||||
return unless @$message? and @$count?
|
||||
|
||||
waitingVisible = true
|
||||
@show @$waiting
|
||||
switch @model.stage
|
||||
when Craftsman::STAGE.WAITING
|
||||
@$message.html 'Preparing crafting calculation...'
|
||||
@@ -57,6 +57,4 @@ module.exports = class CraftsmanWorkingController extends BaseController
|
||||
when Craftsman::STAGE.INVALID
|
||||
@$message.html 'Couldn\'t make a crafting plan'
|
||||
@$count.html ''
|
||||
waitingVisible = false
|
||||
|
||||
if waitingVisible then @show @$waiting else @hide @$waiting
|
||||
@hide @waiting
|
||||
|
||||
Reference in New Issue
Block a user