mirror of
https://github.com/kbparagua/paloma
synced 2023-03-27 23:21:17 -04:00
Make sure to execute all available hooks on the document
This commit is contained in:
parent
92c6695d99
commit
a892d26f08
2 changed files with 7 additions and 6 deletions
|
@ -53,7 +53,6 @@ NotFoos.prototype.otherAction = function(){};
|
|||
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
Paloma.start();
|
||||
|
||||
$('#js-ajax-link').on('click', function(e){
|
||||
|
|
12
vendor/assets/javascripts/paloma/paloma.js
vendored
12
vendor/assets/javascripts/paloma/paloma.js
vendored
|
@ -17,13 +17,15 @@
|
|||
Paloma.engine = new Paloma.Engine({factory: Paloma._controllerFactory});
|
||||
|
||||
Paloma._executeHook = function(){
|
||||
var hook = document.getElementsByClassName('js-paloma-hook')[0];
|
||||
if (!hook) return;
|
||||
var hooks = document.getElementsByClassName('js-paloma-hook');
|
||||
if (hooks.length == 0) return;
|
||||
|
||||
var script = hook.getElementsByTagName('script')[0];
|
||||
if (!script) return;
|
||||
for (var i = 0, n = hooks.length; i < n; i++){
|
||||
var hook = hooks[i],
|
||||
script = hook.getElementsByTagName('script')[0];
|
||||
|
||||
eval(script.innerHTML);
|
||||
if (script) eval(script.innerHTML);
|
||||
}
|
||||
};
|
||||
|
||||
Paloma.start = function(){
|
||||
|
|
Loading…
Reference in a new issue