Slight rejig of form-save.js

This commit is contained in:
Jonny Barnes 2016-06-14 22:40:27 +01:00
parent 0725f75b70
commit 0b3ac065ef
7 changed files with 7 additions and 9 deletions

View file

@ -3,10 +3,8 @@ var feature = {
addEventListener : !!window.addEventListener,
querySelectorAll : !!document.querySelectorAll
};
if(feature.addEventListener && feature.querySelectorAll) {
init();
}
function init() {
if (feature.addEventListener && feature.querySelectorAll) {
var keys = getKeys();
for (var i = 0; i < keys.length; i++) {
if (store.get(keys[i])) {
@ -15,6 +13,7 @@ function init() {
}
}
}
var timerId = window.setInterval(function() {
var saved = false;
var inputs = document.querySelectorAll('input[type=text], textarea');