Updating main JS to not run if not on the index page
This is to get the karma tests in a position where they can be written
This commit is contained in:
parent
8651fd0d9b
commit
dbae70ce52
@ -2,12 +2,15 @@ import Regexper from './regexper.js';
|
||||
|
||||
(function() {
|
||||
var regexper = new Regexper(document.body);
|
||||
regexper.bindListeners();
|
||||
|
||||
setTimeout(() => {
|
||||
var evt = document.createEvent('Event');
|
||||
if (document.body.querySelector('#content')) {
|
||||
regexper.bindListeners();
|
||||
|
||||
evt.initEvent('hashchange', true, true);
|
||||
window.dispatchEvent(evt);
|
||||
});
|
||||
setTimeout(() => {
|
||||
var evt = document.createEvent('Event');
|
||||
|
||||
evt.initEvent('hashchange', true, true);
|
||||
window.dispatchEvent(evt);
|
||||
});
|
||||
}
|
||||
}());
|
||||
|
Loading…
Reference in New Issue
Block a user