Shlomi Fish avatar Shlomi Fish committed fc98a8c

Convert the predicate has_ls() to a boolean variable.


Comments (0)

Files changed (1)


 var toggle_sect_key = "shlomifish.org_section_navigation_menu_shown";
-function has_ls() {
-    return (typeof localStorage !== "undefined" && localStorage !== null);
+var has_ls = (typeof localStorage !== "undefined" && localStorage !== null);
 function toggle_sect_menu() {
     var elem = $("#toggle_sect_menu");
     if (elem.hasClass("off")) {
-        if (has_ls()) {
+        if (has_ls) {
             localStorage.setItem(toggle_sect_key, "1");
     else {
-        if (has_ls()) {
+        if (has_ls) {
 		unique: false
-    if (has_ls()) {
+    if (has_ls) {
         var in_storage = localStorage.getItem(toggle_sect_key);
         var in_elem = $("#toggle_sect_menu").hasClass("on");
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.