Commit a23526c
Changed files (3)
app
assets
javascripts
lib
behaviours
app/assets/javascripts/lib/behaviours/autoview.js.coffee
@@ -0,0 +1,6 @@
+class Autoview extends Stronglifters.Behaviour
+ @on "turbolinks:load"
+
+ execute: ->
+ for element in $("[data-autoview-name]")
+ Stronglifters.Autoview.install(element)
app/assets/javascripts/lib/behaviours/autovue.js.coffee
@@ -0,0 +1,8 @@
+class Autovue extends Stronglifters.Behaviour
+ @on "turbolinks:load"
+
+ execute: ->
+ for element in $("[data-autovue]")
+ window.vue = new Vue
+ el: element
+ data: gon
app/assets/javascripts/application.js.coffee
@@ -32,9 +32,3 @@ window.Stronglifters ?= {}
$(document).on 'turbolinks:load', () =>
new Stronglifters.Startup().start()
Stronglifters.Behaviour.install()
- for element in $("[data-autovue]")
- window.app = new Vue
- el: element
- data: gon
- for element in $("[data-autoview-name]")
- Stronglifters.Autoview.install(element)