Fix two incorrect usages of Array.splice
authorRobert Sesek <rsesek@bluestatic.org>
Wed, 28 Dec 2011 19:36:40 +0000 (14:36 -0500)
committerRobert Sesek <rsesek@bluestatic.org>
Wed, 28 Dec 2011 19:36:40 +0000 (14:36 -0500)
web_frontend/main.js
web_frontend/path_control.js

index f769e8aaa65398742d8e9c595f0c94b747078954..26f03b16359c88fad8eefc11a31aa49c95fa7092 100644 (file)
@@ -68,7 +68,7 @@ armadillo.App.prototype.list = function(path) {
 
     // Add a previous directory entry.
     if (path != '/' && path != '')
-      data.splice(0, 1, '../');
+      data.unshift('../');
 
     // Add items for each entry.
     $.each(data, function(i, file) {
index 39235079d025e9f303e8fdfeb9097de7f7366b5c..80348ab0527bcf691f30b764446993a9ed453613 100644 (file)
@@ -158,7 +158,7 @@ armadillo.PathControl.prototype.fetchMenuContents_ = function(path, name, menu)
     }
 
     // Create an empty node for the current directory.
-    data.splice(0, 1, '/');
+    data.unshift('/');
 
     menu.empty();
     $.each(data, function (i, caption) {