diff options
author | Julius Haertl <jus@bitgrid.net> | 2016-05-27 10:15:27 +0300 |
---|---|---|
committer | Julius Haertl <jus@bitgrid.net> | 2016-05-27 10:15:27 +0300 |
commit | 6e9cc9cfed3e5a520ff82d6f493e0aaa36a835d5 (patch) | |
tree | 39cee3772211a8510d32b179b79d0a1985d9f9da | |
parent | 037015e8f884ac83c5ac2a354dc4378bbe0a8b7b (diff) |
Fix some warnings found by scrutinizer
-rw-r--r-- | js/apporder.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/js/apporder.js b/js/apporder.js index 1ec6a68..892e412 100644 --- a/js/apporder.js +++ b/js/apporder.js @@ -8,12 +8,13 @@ $(function() { // restore existing order $.get(OC.filePath('apporder','ajax','order.php'), { requesttoken: oc_requesttoken}, function(data) { var json = data.order; + var order = [] try { var order = JSON.parse( json ).reverse(); } catch (e) { - var order = [] + order = []; } - if (order.length==0) { + if (order.length === 0) { $('#apps ul').show(); return; } @@ -24,7 +25,7 @@ $(function() { }); $.each(order,function(order,value) { app_menu.prepend(available_apps[value]); - }) + }); $('#apps ul').show(); }); @@ -35,8 +36,8 @@ $(function() { var items = []; $("#apps ul").children().each(function(i,el){ var item = $(el).find('a').attr('href'); - items.push(item) - }) + items.push(item); + }); var json = JSON.stringify(items); localStorage.setItem("apporder-order", json); @@ -53,7 +54,7 @@ $(function() { $("#appsorter").children().each(function(i,el){ var item = $(el).find('a').attr('href'); items.push(item) - }) + }); var json = JSON.stringify(items); $.get(OC.filePath('apporder','ajax','admin.php'), { order: json, requesttoken: oc_requesttoken}, function(data) { $(event.srcElement).effect("highlight", {}, 1000); |