Commit 13d7e05

mo khan <mo@mokhan.ca>
2017-03-12 21:19:48
install behaviours on ready.
1 parent e92a03b
Changed files (2)
app
assets
javascripts
views
app/assets/javascripts/lib/behaviour.js.coffee
@@ -7,6 +7,10 @@ class Stronglifters.Behaviour
 
   @install: ->
     for event of @events
+      @installBehavioursFor(event)
       document.addEventListener event, () =>
-        for behaviour in @events[event]
-          new behaviour().execute()
+        @installBehavioursFor(event)
+
+  @installBehavioursFor: (event) ->
+    for behaviour in @events[event]
+      new behaviour().execute()
app/views/workouts/edit.html.erb
@@ -26,8 +26,3 @@
     </div>
   </div>
 </div>
-
-<% content_for :javascript do %>
-new Stronglifters.Autovue().execute();
-new Stronglifters.AutoviewSetup().execute();
-<% end %>