summaryrefslogtreecommitdiff
path: root/share/www/script/futon.browse.js
diff options
context:
space:
mode:
Diffstat (limited to 'share/www/script/futon.browse.js')
-rw-r--r--share/www/script/futon.browse.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/share/www/script/futon.browse.js b/share/www/script/futon.browse.js
index 65acbdeb..17975de2 100644
--- a/share/www/script/futon.browse.js
+++ b/share/www/script/futon.browse.js
@@ -153,9 +153,13 @@
db.compact({success: function(resp) { callback() }});
break;
case "compact_views":
- var groupname = page.viewName.substring(8,
- page.viewName.indexOf("/_view"));
- db.compactView(groupname, {success: function(resp) { callback() }});
+ var idx = page.viewName.indexOf("/_view");
+ if (idx == -1) {
+ alert("Compact Views requires focus on a view!");
+ } else {
+ var groupname = page.viewName.substring(8, idx);
+ db.compactView(groupname, {success: function(resp) { callback() }});
+ }
break;
case "view_cleanup":
db.viewCleanup({success: function(resp) { callback() }});