diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-07-26 15:41:26 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-07-26 15:41:26 -0700 |
commit | 9aee669886202be7035e6c6049fc71bc99dd3013 (patch) | |
tree | 2fd5bf6de74f3d99270587ffb1833e4188a6373d /rt/share/static/js/history-folding.js | |
parent | ac20214d38d9af00430423f147b5a0e50751b050 (diff) | |
parent | 1add633372bdca3cc7163c2ce48363fed3984437 (diff) |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'rt/share/static/js/history-folding.js')
-rw-r--r-- | rt/share/static/js/history-folding.js | 26 |
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; +} |