Skip to content

Instantly share code, notes, and snippets.

@nerdfiles
Last active December 17, 2015 05:19
Show Gist options
  • Save nerdfiles/5557484 to your computer and use it in GitHub Desktop.
Save nerdfiles/5557484 to your computer and use it in GitHub Desktop.
Error Modal microview via Foundation Reveal Specification
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