Sha256: d9f5b0c0dd42065c24e13644f66ba052352f91f8674ef8fb44b869f00b5cccd8
Contents?: true
Size: 646 Bytes
Versions: 11
Compression:
Stored size: 646 Bytes
Contents
window.controllers = {} let handler = function(){ var $body = $("body"); var controller = $body.data("controller").replace(/\//g, "_"); var action = $body.data("action"); var activeController = window.controllers[controller]; if (activeController !== undefined) { if (window.env == "development") { console.log("[Controllers] " + controller + "." + action + "()"); } if ($.isFunction(activeController.init)) { activeController.init(); } if ($.isFunction(activeController[action])) { activeController[action](); } } } // $(handler); document.addEventListener("turbolinks:load", handler)
Version data entries
11 entries across 11 versions & 1 rubygems