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