mirror of
https://github.com/kbparagua/paloma
synced 2023-03-27 23:21:17 -04:00
Execute only the first hook found on DOM
This commit is contained in:
parent
a892d26f08
commit
430fa37ee8
1 changed files with 2 additions and 9 deletions
11
vendor/assets/javascripts/paloma/paloma.js
vendored
11
vendor/assets/javascripts/paloma/paloma.js
vendored
|
@ -17,15 +17,8 @@
|
|||
Paloma.engine = new Paloma.Engine({factory: Paloma._controllerFactory});
|
||||
|
||||
Paloma._executeHook = function(){
|
||||
var hooks = document.getElementsByClassName('js-paloma-hook');
|
||||
if (hooks.length == 0) return;
|
||||
|
||||
for (var i = 0, n = hooks.length; i < n; i++){
|
||||
var hook = hooks[i],
|
||||
script = hook.getElementsByTagName('script')[0];
|
||||
|
||||
if (script) eval(script.innerHTML);
|
||||
}
|
||||
var hook = document.querySelector('.js-paloma-hook script');
|
||||
if (hook) eval(hook.innerHTML);
|
||||
};
|
||||
|
||||
Paloma.start = function(){
|
||||
|
|
Loading…
Reference in a new issue