diff options
author | Christopher Lenz <cmlenz@apache.org> | 2008-10-01 13:52:59 +0000 |
---|---|---|
committer | Christopher Lenz <cmlenz@apache.org> | 2008-10-01 13:52:59 +0000 |
commit | 57f2e6a118dc57af6dbd6c377b60bae7fdcd3d22 (patch) | |
tree | 9ed078c70e49c2a3e62f91783b5f60b019599d01 /share/www/browse/database.html | |
parent | a502eb9880d20dbd69ac206e5145c646fdb26232 (diff) |
Make the database list in the sidebar in Futon a list of the 10 most recently used databases, to avoid excessive script/render time with instances containing very many databases.
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@700767 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/browse/database.html')
-rw-r--r-- | share/www/browse/database.html | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/share/www/browse/database.html b/share/www/browse/database.html index 0dd086db..fe17a47b 100644 --- a/share/www/browse/database.html +++ b/share/www/browse/database.html @@ -32,6 +32,13 @@ specific language governing permissions and limitations under the License. if (window != parent) { parent.updateNavigation(location.pathname, encodeURIComponent(location.search.split("/", 2)[0])); + var recentDbs = $.cookies.get("recent", "").split(","); + if ($.inArray(page.db.name, recentDbs) == -1) { + recentDbs.unshift(page.db.name); + if (recentDbs.length > 10) recentDbs.length = 10; + $.cookies.set("recent", recentDbs.join(","), parent.location.pathname); + parent.updateRecentDatabasesList(); + } } $(document).ready(function() { |