Last active
August 29, 2015 14:04
-
-
Save ionox0/bf34dd0319029dc7823f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MM: | |
App.request('get:photos:recent').fetch().done -> | |
App.vent.trigger 'recentphotos:fetch:success' | |
effects Show.Controller | |
App.vent.on 'recentphotos:fetch:success', -> | |
effectContainer.collection.addEffect('MosaicPhotos') | |
_.each view.effects, (effectClassName, effectEvent) => | |
view.on effectEvent, (mediaType) => | |
App.execute("update:header", mediaType: mediaType) # store the media type for url proper building | |
effectContainer.showEffect effectClassName | |
view.on "#{effectEvent}:mouseout", => | |
effectContainer.triggerMouseout effectClassName | |
effects EffectsContainer | |
showEffect: (effectClassName) -> | |
#if effects besides 'MosaicPhotos' fall victim to async errors, add them on fetch:success events as well | |
@collection.addEffect effectClassName unless effectClassName is 'MosaicPhotos' | |
@children.each (view) => | |
if view.model instanceof Show[effectClassName] | |
@fadeIn view | |
view.trigger("mouseover") | |
else | |
@fadeOut view |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment