Fine tune animation timings
This commit is contained in:
@@ -49,7 +49,7 @@ module.exports = class CraftingGridController extends BaseController
|
|||||||
@_imageLoader.load display.iconUrl, slot.img
|
@_imageLoader.load display.iconUrl, slot.img
|
||||||
slot.img.attr 'alt', display.itemName
|
slot.img.attr 'alt', display.itemName
|
||||||
|
|
||||||
@$el.tooltip show:{delay:Duration.slow, duration:Duration.fast}
|
@$el.tooltip show:{delay:Duration.snap, duration:Duration.fast}
|
||||||
super
|
super
|
||||||
|
|
||||||
# Backbone.View Overrides ######################################################################
|
# Backbone.View Overrides ######################################################################
|
||||||
|
|||||||
@@ -78,9 +78,9 @@ module.exports = class CraftingTableController extends BaseController
|
|||||||
@$multiplier.html ''
|
@$multiplier.html ''
|
||||||
|
|
||||||
if not (@model.hasSteps and global.feedbackController?)
|
if not (@model.hasSteps and global.feedbackController?)
|
||||||
@$problemControl.hide duration:Duration.fast
|
@$problemControl.hide duration:Duration.snap
|
||||||
else
|
else
|
||||||
@$problemControl.show duration:Duration.normal
|
@$problemControl.show duration:Duration.snap
|
||||||
|
|
||||||
super
|
super
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ module.exports = class FeedbackController extends BaseController
|
|||||||
@model.send(message)
|
@model.send(message)
|
||||||
.then =>
|
.then =>
|
||||||
@onToggle()
|
@onToggle()
|
||||||
@$error.slideUp duration:Duration.fast
|
@$error.slideUp duration:Duration.normal
|
||||||
.catch (error)=>
|
.catch (error)=>
|
||||||
@$error.slideDown duration:Duration.normal
|
@$error.slideDown duration:Duration.normal
|
||||||
.finally =>
|
.finally =>
|
||||||
@@ -97,7 +97,7 @@ module.exports = class FeedbackController extends BaseController
|
|||||||
@$sendButton = @$('button[name="send"]')
|
@$sendButton = @$('button[name="send"]')
|
||||||
|
|
||||||
windowHeight = window.innerHeight
|
windowHeight = window.innerHeight
|
||||||
@$el.delay(Duration.slow).animate {left:-@$el.outerWidth()}, Duration.slow
|
@$el.delay(Duration.slow).animate {left:-@$el.outerWidth()}, Duration.normal
|
||||||
@onTextChanged()
|
@onTextChanged()
|
||||||
|
|
||||||
super
|
super
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ module.exports = class FullRecipeController extends BaseController
|
|||||||
@gridController.model = @model
|
@gridController.model = @model
|
||||||
@$tool.html @_findToolNames().join ', '
|
@$tool.html @_findToolNames().join ', '
|
||||||
|
|
||||||
@$el.tooltip show:{delay:Duration.fast, duration:Duration.fast}
|
@$el.tooltip show:{delay:Duration.normal, duration:Duration.normal}
|
||||||
|
|
||||||
@_refreshInputs()
|
@_refreshInputs()
|
||||||
@_refreshOutputs()
|
@_refreshOutputs()
|
||||||
|
|||||||
@@ -97,8 +97,8 @@ module.exports = class InventoryController extends BaseController
|
|||||||
@$quantityField.focus()
|
@$quantityField.focus()
|
||||||
return
|
return
|
||||||
|
|
||||||
@$quantityField.removeClass 'error', Duration.fast
|
@$quantityField.removeClass 'error', Duration.normal
|
||||||
@$quantityField.removeClass 'error-new', Duration.fast
|
@$quantityField.removeClass 'error-new', Duration.normal
|
||||||
@_updateButtonState()
|
@_updateButtonState()
|
||||||
|
|
||||||
onQuantityFieldFocused: ->
|
onQuantityFieldFocused: ->
|
||||||
|
|||||||
@@ -95,8 +95,8 @@ module.exports = class InventoryTableController extends BaseController
|
|||||||
@$quantityField.focus()
|
@$quantityField.focus()
|
||||||
return
|
return
|
||||||
|
|
||||||
@$quantityField.removeClass 'error', Duration.fast
|
@$quantityField.removeClass 'error', Duration.normal
|
||||||
@$quantityField.removeClass 'error-new', Duration.fast
|
@$quantityField.removeClass 'error-new', Duration.normal
|
||||||
@_updateButtonState()
|
@_updateButtonState()
|
||||||
|
|
||||||
onQuantityFieldFocused: ->
|
onQuantityFieldFocused: ->
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ module.exports = class ItemGroupController extends BaseController
|
|||||||
options.templateName = 'item_group'
|
options.templateName = 'item_group'
|
||||||
super options
|
super options
|
||||||
|
|
||||||
|
@_delayStep = 20
|
||||||
@_itemControllers = []
|
@_itemControllers = []
|
||||||
@_modPack = options.modPack
|
@_modPack = options.modPack
|
||||||
@_title = options.title
|
@_title = options.title
|
||||||
@@ -53,12 +54,12 @@ module.exports = class ItemGroupController extends BaseController
|
|||||||
|
|
||||||
_createItemController: (item)->
|
_createItemController: (item)->
|
||||||
controller = new ItemController model:item, modPack:@_modPack
|
controller = new ItemController model:item, modPack:@_modPack
|
||||||
controller.$el.hide()
|
|
||||||
controller.render()
|
|
||||||
|
|
||||||
@_itemControllers.push controller
|
@_itemControllers.push controller
|
||||||
|
|
||||||
|
controller.render()
|
||||||
|
controller.$el.hide()
|
||||||
@$items.append controller.$el
|
@$items.append controller.$el
|
||||||
controller.$el.slideDown duration:Duration.fast
|
controller.$el.fadeIn duration:Duration.fast
|
||||||
|
|
||||||
_refreshItems: ->
|
_refreshItems: ->
|
||||||
controllerIndex = 0
|
controllerIndex = 0
|
||||||
@@ -77,4 +78,4 @@ module.exports = class ItemGroupController extends BaseController
|
|||||||
|
|
||||||
while @_itemControllers.length > controllerIndex
|
while @_itemControllers.length > controllerIndex
|
||||||
controller = @_itemControllers.pop()
|
controller = @_itemControllers.pop()
|
||||||
controller.$el.slideUp duration:Duration.fast, complete:-> @remove()
|
controller.$el.fadeOut duration:Duration.normal, complete:-> @remove()
|
||||||
|
|||||||
@@ -60,11 +60,11 @@ module.exports = class ItemPageController extends BaseController
|
|||||||
display = @_modPack.findItemDisplay @model.item?.slug
|
display = @_modPack.findItemDisplay @model.item?.slug
|
||||||
if display?
|
if display?
|
||||||
@$craftingPlanLink.attr href:display.craftingUrl
|
@$craftingPlanLink.attr href:display.craftingUrl
|
||||||
@$craftingPlanLink.fadeIn duration:Duration.fast
|
@$craftingPlanLink.fadeIn duration:Duration.normal
|
||||||
@_imageLoader.load display.iconUrl, @$titleImage
|
@_imageLoader.load display.iconUrl, @$titleImage
|
||||||
@$name.html display.itemName
|
@$name.html display.itemName
|
||||||
else
|
else
|
||||||
@$craftingPlanLink.fadeOut duration:Duration.fast
|
@$craftingPlanLink.fadeOut duration:Duration.normal
|
||||||
@$titleImage.removeAttr 'src'
|
@$titleImage.removeAttr 'src'
|
||||||
@$name.html ''
|
@$name.html ''
|
||||||
|
|
||||||
@@ -89,18 +89,18 @@ module.exports = class ItemPageController extends BaseController
|
|||||||
if mod?.name?.length > 0
|
if mod?.name?.length > 0
|
||||||
@$bylineLink.attr 'href', Url.mod modSlug:mod.slug
|
@$bylineLink.attr 'href', Url.mod modSlug:mod.slug
|
||||||
@$bylineLink.html mod.name
|
@$bylineLink.html mod.name
|
||||||
@$byline.fadeIn duration:Duration.fast
|
@$byline.fadeIn duration:Duration.normal
|
||||||
else
|
else
|
||||||
@$byline.fadeOut duration:Duration.fast
|
@$byline.fadeOut duration:Duration.normal
|
||||||
|
|
||||||
_refreshUsedToMake: ->
|
_refreshUsedToMake: ->
|
||||||
@_usedToMakeController.title = 'Used to Make'
|
@_usedToMakeController.title = 'Used to Make'
|
||||||
|
|
||||||
@_usedToMakeController.model = @model.findComponentInItems()
|
@_usedToMakeController.model = @model.findComponentInItems()
|
||||||
if @_usedToMakeController.model?
|
if @_usedToMakeController.model?
|
||||||
@$usedToMakeContainer.fadeIn duration:Duration.fast
|
@$usedToMakeContainer.fadeIn duration:Duration.normal
|
||||||
else
|
else
|
||||||
@$usedToMakeContainer.fadeOut duration:Duration.fast
|
@$usedToMakeContainer.fadeOut duration:Duration.normal
|
||||||
|
|
||||||
_refreshRecipes: ->
|
_refreshRecipes: ->
|
||||||
@_recipeControllers ?= []
|
@_recipeControllers ?= []
|
||||||
@@ -123,11 +123,11 @@ module.exports = class ItemPageController extends BaseController
|
|||||||
controller.model = recipe
|
controller.model = recipe
|
||||||
index++
|
index++
|
||||||
else
|
else
|
||||||
@$recipesSection.fadeOut duration:Duration.fast
|
@$recipesSection.fadeOut duration:Duration.normal
|
||||||
|
|
||||||
while @_recipeControllers.length > index
|
while @_recipeControllers.length > index
|
||||||
controller = @_recipeControllers.pop()
|
controller = @_recipeControllers.pop()
|
||||||
controller.fadeOut duration:Duration.fast, complete:-> controller.$el.remove()
|
controller.fadeOut duration:Duration.normal, complete:-> controller.$el.remove()
|
||||||
|
|
||||||
_refreshSimilarItems: ->
|
_refreshSimilarItems: ->
|
||||||
group = @model.item?.group
|
group = @model.item?.group
|
||||||
@@ -138,9 +138,9 @@ module.exports = class ItemPageController extends BaseController
|
|||||||
@_similarItemsController.model = null
|
@_similarItemsController.model = null
|
||||||
|
|
||||||
if @_similarItemsController.model?
|
if @_similarItemsController.model?
|
||||||
@$similarContainer.fadeIn duration:Duration.fast
|
@$similarContainer.fadeIn duration:Duration.normal
|
||||||
else
|
else
|
||||||
@$similarContainer.fadeOut duration:Duration.fast
|
@$similarContainer.fadeOut duration:Duration.normal
|
||||||
|
|
||||||
_resolveItemSlug: ->
|
_resolveItemSlug: ->
|
||||||
oldItem = @model.item
|
oldItem = @model.item
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ module.exports = class MinimalRecipeController extends BaseController
|
|||||||
|
|
||||||
@_imageLoader.load display.iconUrl, @$outputImg
|
@_imageLoader.load display.iconUrl, @$outputImg
|
||||||
|
|
||||||
@$el.tooltip show:{delay:Duration.fast, duration:Duration.fast}
|
@$el.tooltip show:{delay:Duration.snap, duration:Duration.fast}
|
||||||
|
|
||||||
super
|
super
|
||||||
|
|
||||||
|
|||||||
@@ -110,14 +110,14 @@ module.exports = class ModPageController extends BaseController
|
|||||||
|
|
||||||
while @_groupControllers.length > groupIndex + 1
|
while @_groupControllers.length > groupIndex + 1
|
||||||
controller = @_groupControllers.pop()
|
controller = @_groupControllers.pop()
|
||||||
controller.$el.slideUp duration:Duration.fast, -> @remove()
|
controller.$el.slideUp duration:Duration.normal, -> @remove()
|
||||||
|
|
||||||
_refreshLink: ($link, url)->
|
_refreshLink: ($link, url)->
|
||||||
if url?
|
if url?
|
||||||
$link.fadeIn duration:Duration.fast
|
$link.fadeIn duration:Duration.normal
|
||||||
$link.attr 'href', url
|
$link.attr 'href', url
|
||||||
else
|
else
|
||||||
$link.fadeOut duration:Duration.fast
|
$link.fadeOut duration:Duration.normal
|
||||||
|
|
||||||
_refreshVersions: ->
|
_refreshVersions: ->
|
||||||
@$versionSelector.empty()
|
@$versionSelector.empty()
|
||||||
|
|||||||
Reference in New Issue
Block a user