-
-
Save ConradIrwin/d7dc518cadca621f2e8a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# <body data-controller="dashboard/errors" data-action="index"> | |
# -> dashboard/errors/index -> ErrorsIndex | |
pageClass = () -> | |
path = $('body').data('controller') + "/" + $('body').data('action') | |
className = path.replace(/(?:^(?:dashboard\/)?|\/)(.)/g, (m, l) -> l.toUpperCase()) | |
return window[className] | |
$ -> | |
if Klass = pageClass() | |
new Klass($('body')) | |
$("body").bugsnagBehavior() | |
# An angular module for the dashboard. | |
# Depends on 'templates' from angular-rails-templates. | |
# Depends on 'ng-rails'csrf' for csrf protection. | |
@Dashboard = angular.module('dashboard', ['templates', 'ng-rails-csrf', 'angular.ujs', 'ngAnimate']) | |
Reflux.ActionMethods.alert = (x) -> | |
Reflux.ActionMethods.implement = (callback) -> | |
@listenAndPromise => | |
@_running = callback.apply(this, arguments) | |
Reflux.ActionMethods.triggerPromise = -> | |
@trigger.apply(this, arguments) | |
@_running | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment