From 9b027bdd9c4a791a7623797f2fecf0d2e9bfd0c2 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 28 Dec 2011 14:36:40 -0500 Subject: [PATCH] Fix two incorrect usages of Array.splice --- web_frontend/main.js | 2 +- web_frontend/path_control.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web_frontend/main.js b/web_frontend/main.js index f769e8a..26f03b1 100644 --- a/web_frontend/main.js +++ b/web_frontend/main.js @@ -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) { diff --git a/web_frontend/path_control.js b/web_frontend/path_control.js index 3923507..80348ab 100644 --- a/web_frontend/path_control.js +++ b/web_frontend/path_control.js @@ -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) { -- 2.43.5