summaryrefslogtreecommitdiffstats
path: root/hyperkitty/static/js/hyperkitty.js
diff options
context:
space:
mode:
authorAurélien Bompard <aurelien@bompard.org>2013-02-07 14:52:18 +0100
committerAurélien Bompard <aurelien@bompard.org>2013-02-07 15:00:29 +0100
commitaae9a5a1b6c75095817c0914ef7b92e63903fc2e (patch)
tree6173bf6f1f64f1296dabf792e63679e9e955b53f /hyperkitty/static/js/hyperkitty.js
parent76e48cc49fc7c73ba9642129059c2e51234c3fe6 (diff)
downloadhyperkitty-aae9a5a1b6c75095817c0914ef7b92e63903fc2e.tar.gz
hyperkitty-aae9a5a1b6c75095817c0914ef7b92e63903fc2e.tar.xz
hyperkitty-aae9a5a1b6c75095817c0914ef7b92e63903fc2e.zip
Fix the tags search view (#35)
And factor some views/templates while I'm at it. And remove unused/obsolete stuff in the same move.
Diffstat (limited to 'hyperkitty/static/js/hyperkitty.js')
-rw-r--r--hyperkitty/static/js/hyperkitty.js25
1 files changed, 23 insertions, 2 deletions
diff --git a/hyperkitty/static/js/hyperkitty.js b/hyperkitty/static/js/hyperkitty.js
index 6fb7ef8..d5898dc 100644
--- a/hyperkitty/static/js/hyperkitty.js
+++ b/hyperkitty/static/js/hyperkitty.js
@@ -296,8 +296,28 @@ function setup_quotes() {
function setup_months_list() {
var current = $("#months-list li.current").parent().prev();
- if (!current.length) { current = 0; } // overview
- $("#months-list").accordion({ active: current });
+ if (!current.length) {
+ current = false; // overview or search
+ } else {
+ current = current.prevAll("h3").length;
+ }
+ $("#months-list").accordion({ collapsible: true, active: current });
+}
+
+function setup_expander() {
+ $('span.expander').expander({
+ slicePoint: 500,
+ userCollapseText : '\n[-]',
+ expandText : '\n[+]',
+ beforeExpand: function() {
+ $(this).removeClass("collapsed");
+ $(this).addClass("expanded");
+ },
+ onCollapse: function() {
+ $(this).removeClass("expanded");
+ $(this).addClass("collapsed");
+ }
+ });
}
@@ -313,4 +333,5 @@ $(document).ready(function() {
setup_months_list();
setup_favorites();
setup_replies();
+ setup_expander();
});