]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - app/Resources/static/themes/_global/js/restoreScroll.js
clean & lint stuff
[github/wallabag/wallabag.git] / app / Resources / static / themes / _global / js / restoreScroll.js
index e63d06c695985b998d1eda35cfc2760be0e5294b..9c4d7e20b94f85822159cfe8b2c3520dd8aa13e3 100644 (file)
@@ -1,25 +1,25 @@
 function supportsLocalStorage() {
-    try {
-        return 'localStorage' in window && window['localStorage'] !== null;
-    } catch (e) {
-        return false;
-    }
+  try {
+    return 'localStorage' in window && window.localStorage !== null;
+  } catch (e) {
+    return false;
+  }
 }
 
 function savePercent(id, percent) {
-    if (!supportsLocalStorage()) { return false; }
-    localStorage["wallabag.article." + id + ".percent"] = percent;
-    return true;
+  if (!supportsLocalStorage()) { return false; }
+  localStorage['wallabag.article.' + id + '.percent'] = percent;
+  return true;
 }
 
 function retrievePercent(id) {
-    if (!supportsLocalStorage()) { return false; }
+  if (!supportsLocalStorage()) { return false; }
 
-    var bheight = $(document).height();
-    var percent = localStorage["wallabag.article." + id + ".percent"];
-    var scroll = bheight * percent;
+  var bheight = $(document).height();
+  var percent = localStorage['wallabag.article.' + id + '.percent'];
+  var scroll = bheight * percent;
 
-    $('html,body').animate({scrollTop: scroll}, 'fast');
+  $('html,body').animate({ scrollTop: scroll }, 'fast');
 
-    return true;
+  return true;
 }