Adjust animations, fix bugs, and tweak a few algos
* Adjust page change animations to slide the page closed and then open again. * Add Railcraft to the standard set of mods * Change every controller which uses an `ImageLoader` to only accept it from a parent controller (with the router creating the one shared instance). * Fix several places where controllers need to refresh when the mod pack changes * Fix a few places which should be using the `ImageLoader` but were not. * Remove a number of animations which caused performance issues (esp. animating individual items in item group views). * Fix a bug where changing the current version of a mod didn't cause the current crafting plan to be re-evaluated * Simplify the name finder to allow regular expressions instead of the current algorithm
This commit is contained in:
@@ -13,6 +13,7 @@ CraftingPageController = require './controllers/crafting_page_controller'
|
||||
HeaderController = require './controllers/header_controller'
|
||||
ItemPageController = require './controllers/item_page_controller'
|
||||
ItemSlug = require './models/item_slug'
|
||||
ImageLoader = require './controllers/image_loader'
|
||||
Mod = require './models/mod'
|
||||
ModPack = require './models/mod_pack'
|
||||
ModPageController = require './controllers/mod_page_controller'
|
||||
@@ -31,9 +32,10 @@ module.exports = class CraftingGuideRouter extends Backbone.Router
|
||||
@_lastReported = null
|
||||
super options
|
||||
|
||||
@modPack = new ModPack
|
||||
@storage = new Storage storage:window.localStorage
|
||||
@_defaultOptions = modPack:@modPack, storage:@storage
|
||||
@imageLoader = new ImageLoader defaultUrl:'/images/unknown.png'
|
||||
@modPack = new ModPack
|
||||
@storage = new Storage storage:window.localStorage
|
||||
@_defaultOptions = imageLoader:@imageLoader, modPack:@modPack, storage:@storage
|
||||
|
||||
@headerController = new HeaderController el:'.view__header'
|
||||
|
||||
@@ -124,11 +126,11 @@ module.exports = class CraftingGuideRouter extends Backbone.Router
|
||||
controller.$el.addClass 'page'
|
||||
$pageContent.replaceWith controller.$el
|
||||
|
||||
controller.$el.fadeIn showDuration, ->
|
||||
controller.$el.slideDown showDuration, ->
|
||||
controller.onDidShow()
|
||||
|
||||
if @_controller?
|
||||
showDuration = Duration.long
|
||||
@_controller.$el.fadeOut showDuration, show
|
||||
showDuration = showDuration / 2
|
||||
@_controller.$el.slideUp showDuration, show
|
||||
else
|
||||
show()
|
||||
|
||||
Reference in New Issue
Block a user