Redesign the crafting page
This introduces the new crafting page design featuring a new vertical layout and list display of all crafting steps. It also makes it easy to move items between the have/need sections and even from each step into your inventory (causing a new crafting plan to be created which doesn't plan on making that item). * Convert the `BaseController.hide` and `show` methods to be much more robust in the use of CSS transitions (using a timer in case a transition doesn't actually fire). * Change `hide`/`show` to use events for communicating animation state instead of callbacks * Convert several controllers to fire events for communication with parent controllers instead of accepting functions. * Rewrite the `CraftPageController`, `CraftPage` model and related Jade/SCSS files to implement the new design. * Alter the `InventoryController` and `StackController` to allow a variety of action buttons, and for the events from those action buttons to bubble up to parent controllers * Add the `StepController` and its related model, template, and style sheet as part of the new craft page. * Tweak the `ItemSelectorController` and related files to allow for a variety of styles for the launcher button
This commit is contained in:
+32
-19
@@ -37,32 +37,45 @@ Duration.fast = 200
|
||||
Duration.normal = 400
|
||||
Duration.slow = 1200
|
||||
|
||||
exports.Event = Event = {}
|
||||
Event.add = 'add' # collection, item...
|
||||
Event.change = 'change' # model
|
||||
Event.click = 'click' # event
|
||||
Event.load = {}
|
||||
Event.load.started = 'load:started' # controller, url
|
||||
Event.load.succeeded = 'load:succeeded' # controller, book
|
||||
Event.load.failed = 'load:failed' # controller, error message
|
||||
Event.load.finished = 'load:finished' # controller
|
||||
Event.remove = 'remove' # collection, item...
|
||||
Event.request = 'request' # model
|
||||
Event.route = 'route'
|
||||
Event.sort = 'sort'
|
||||
Event.sync = 'sync' # model, response
|
||||
Event.transitionEnd = (->
|
||||
exports.Event = Event = {}
|
||||
Event.add = 'add' # collection, item...
|
||||
Event.animate = {}
|
||||
Event.animate.hide = {}
|
||||
Event.animate.hide.start = 'animate:hide:start' # controller, selector
|
||||
Event.animate.hide.finish = 'animate:hide:finish' # controller, selector
|
||||
Event.animate.show = {}
|
||||
Event.animate.show.start = 'animate:show:start' # controller, selector
|
||||
Event.animate.show.finish = 'animate:show:finish' # controller, selector
|
||||
Event.button = {}
|
||||
Event.button.complete = 'button:complete' # controller
|
||||
Event.button.first = 'button:first' # controller, buttonType
|
||||
Event.button.second = 'button:second' # controller, buttonType
|
||||
Event.change = 'change' # model
|
||||
Event.click = 'click' # event
|
||||
Event.load = {}
|
||||
Event.load.started = 'load:started' # controller, url
|
||||
Event.load.succeeded = 'load:succeeded' # controller, book
|
||||
Event.load.failed = 'load:failed' # controller, error message
|
||||
Event.load.finished = 'load:finished' # controller
|
||||
Event.remove = 'remove' # collection, item...
|
||||
Event.request = 'request' # model
|
||||
Event.route = 'route'
|
||||
Event.sort = 'sort'
|
||||
Event.sync = 'sync' # model, response
|
||||
Event.transitionEnd = (->
|
||||
return unless document?
|
||||
transitions =
|
||||
'transition': 'transitionend',
|
||||
'OTransition': 'oTransitionEnd',
|
||||
'MSTransition': 'msTransitionEnd',
|
||||
'MozTransition': 'transitionend',
|
||||
'WebkitTransition': 'webkitTransitionEnd'
|
||||
'MozTransition': 'transitionend'
|
||||
'MSTransition': 'msTransitionEnd'
|
||||
'OTransition': 'oTransitionEnd'
|
||||
'transition': 'transitionend'
|
||||
|
||||
el = document.createElement 'fakeelement'
|
||||
for styleName, eventName of transitions
|
||||
return eventName if el.style[styleName]?
|
||||
|
||||
throw new Error 'cannot determine transitionEnd event'
|
||||
)()
|
||||
|
||||
exports.Key = Key = {}
|
||||
|
||||
Reference in New Issue
Block a user