Last active
December 17, 2015 05:19
-
-
Save nerdfiles/5557484 to your computer and use it in GitHub Desktop.
Error Modal microview via Foundation Reveal Specification
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
class APP_NAME.App.MicroViews.ErrorView extends Backbone.View | |
el: $('.app--page') | |
close: () -> | |
@undelegateEvents() | |
last_modal = $('.error-modal').detach() | |
initialize: () -> | |
@content = @options.content | |
@render() | |
@reveal_defaults = | |
closeOnBackgroundClick: false | |
animation: 'fade' | |
closed: () => | |
@close() | |
$('.error-modal').reveal @reveal_defaults | |
render: () -> | |
template = _.template $("#app-error").html() | |
data = | |
content: @content | |
# bring to fore, think of Readers | |
@$el.find('.m--module').prepend template | |
events: | |
"click .button": "close_modal" | |
close_modal: (e) -> | |
$('.error-modal.open').trigger 'reveal:close' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment