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() {
|
(function() {
|
||||||
var regexper = new Regexper(document.body);
|
var regexper = new Regexper(document.body);
|
||||||
regexper.bindListeners();
|
|
||||||
|
|
||||||
setTimeout(() => {
|
if (document.body.querySelector('#content')) {
|
||||||
var evt = document.createEvent('Event');
|
regexper.bindListeners();
|
||||||
|
|
||||||
evt.initEvent('hashchange', true, true);
|
setTimeout(() => {
|
||||||
window.dispatchEvent(evt);
|
var evt = document.createEvent('Event');
|
||||||
});
|
|
||||||
|
evt.initEvent('hashchange', true, true);
|
||||||
|
window.dispatchEvent(evt);
|
||||||
|
});
|
||||||
|
}
|
||||||
}());
|
}());
|
||||||
|
Loading…
Reference in New Issue
Block a user