summaryrefslogtreecommitdiff
path: root/rt/share/static/js/history-folding.js
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2015-07-09 22:18:55 -0700
committerIvan Kohler <ivan@freeside.biz>2015-07-09 22:18:55 -0700
commit1c538bfabc2cd31f27067505f0c3d1a46cba6ef0 (patch)
tree96922ad4459eda1e649327fd391d60c58d454c53 /rt/share/static/js/history-folding.js
parent4f5619288413a185e9933088d9dd8c5afbc55dfa (diff)
RT 4.2.11, ticket#13852
Diffstat (limited to 'rt/share/static/js/history-folding.js')
-rw-r--r--rt/share/static/js/history-folding.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/rt/share/static/js/history-folding.js b/rt/share/static/js/history-folding.js
new file mode 100644
index 000000000..14db0db39
--- /dev/null
+++ b/rt/share/static/js/history-folding.js
@@ -0,0 +1,26 @@
+function fold_message_stanza(e,showmsg, hidemsg) {
+ var box = jQuery(e).next('.message-stanza');
+ if ( box.hasClass('closed') ) {
+ jQuery([e, box[0]]).removeClass('closed').addClass('open');
+ jQuery(e).text( hidemsg);
+ } else {
+ jQuery([e, box[0]]).addClass('closed').removeClass('open');
+ jQuery(e).text( showmsg);
+ }
+}
+
+function toggle_all_folds(e, showmsg, hidemsg) {
+ var link = jQuery(e);
+ var history = link.closest(".history");
+ var dir = link.attr('data-direction');
+
+ if (dir == 'open') {
+ history.find(".message-stanza-folder.closed").click();
+ link.attr('data-direction', 'closed').text(hidemsg);
+ }
+ else if (dir == 'closed') {
+ history.find(".message-stanza-folder.open").click();
+ link.attr('data-direction', 'open').text(showmsg);
+ }
+ return false;
+}