diff options
author | Christopher Lenz <cmlenz@apache.org> | 2009-12-11 23:00:17 +0000 |
---|---|---|
committer | Christopher Lenz <cmlenz@apache.org> | 2009-12-11 23:00:17 +0000 |
commit | ae46d1ed6221af19cbc060b879f80d81d227651c (patch) | |
tree | 848d7235f19a4a5c6e65a05fb1c8e093329e02b8 /share | |
parent | f51ffa07b3faf0c1e1984b2853e4c8af36ae3289 (diff) |
Futon: Remember tabular vs. source tab preference in a cookie.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@889846 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share')
-rw-r--r-- | share/www/script/futon.browse.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/share/www/script/futon.browse.js b/share/www/script/futon.browse.js index 733c9d08..4b033b28 100644 --- a/share/www/script/futon.browse.js +++ b/share/www/script/futon.browse.js @@ -731,6 +731,8 @@ } var db = $.couch.db(dbName); + $.futon.storage.declare("tab", {defaultValue: "tabular", scope: "cookie"}); + this.dbName = dbName; this.db = db; this.docId = docId; @@ -742,13 +744,16 @@ if ($("#fields tbody.source textarea").length > 0) return; + $.futon.storage.set("tab", "tabular"); $("#tabs li").removeClass("active").filter(".tabular").addClass("active"); $("#fields thead th:first").text("Field").attr("colspan", 1).next().show(); $("#fields tbody.content").show(); $("#fields tbody.source").hide(); + return false; } this.activateSourceView = function() { + $.futon.storage.set("tab", "source"); $("#tabs li").removeClass("active").filter(".source").addClass("active"); $("#fields thead th:first").text("Source").attr("colspan", 2).next().hide(); $("#fields tbody.content").hide(); @@ -789,6 +794,7 @@ } }); }).end().show(); + return false; } this.addField = function() { @@ -855,7 +861,7 @@ $("#fields tbody.footer td span").text("Showing revision " + (revs.length - currentIndex) + " of " + revs.length); } - if (location.hash == "#source" && !noReload) { + if ($.futon.storage.get("tab") == "source") { page.activateSourceView(); } } |