aboutsummaryrefslogtreecommitdiffstats
path: root/vimiumFrontend.js
diff options
context:
space:
mode:
authorjez2010-12-28 22:30:35 +0800
committerjez2010-12-28 22:30:35 +0800
commit064a8b523ea53d4999bbd5987be5dc3db5caa4c8 (patch)
tree068ddf6fb1ad210113cd6023deb05929104ba6d1 /vimiumFrontend.js
parentbb9387946cb573123a33541eb01b90fd8f9a744d (diff)
downloadvimium-064a8b523ea53d4999bbd5987be5dc3db5caa4c8.tar.bz2
Add command repetition for goUp command. Closes #179.
Diffstat (limited to 'vimiumFrontend.js')
-rw-r--r--vimiumFrontend.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/vimiumFrontend.js b/vimiumFrontend.js
index e3c28371..a18c7966 100644
--- a/vimiumFrontend.js
+++ b/vimiumFrontend.js
@@ -266,7 +266,7 @@ function reload() { window.location.reload(); }
function goBack() { history.back(); }
function goForward() { history.forward(); }
-function goUp() {
+function goUp(count) {
var url = window.location.href;
if (url[url.length-1] == '/')
url = url.substring(0, url.length - 1);
@@ -274,7 +274,7 @@ function goUp() {
var urlsplit = url.split('/');
// make sure we haven't hit the base domain yet
if (urlsplit.length > 3) {
- delete urlsplit[urlsplit.length-1];
+ urlsplit = urlsplit.slice(0, Math.max(3, urlsplit.length - count));
window.location.href = urlsplit.join('/');
}
}