summaryrefslogtreecommitdiffstats
path: root/src/main/resources/gitblit/js/collapsible-table.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/resources/gitblit/js/collapsible-table.js')
-rw-r--r--src/main/resources/gitblit/js/collapsible-table.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/main/resources/gitblit/js/collapsible-table.js b/src/main/resources/gitblit/js/collapsible-table.js
new file mode 100644
index 00000000..538b412e
--- /dev/null
+++ b/src/main/resources/gitblit/js/collapsible-table.js
@@ -0,0 +1,32 @@
+$(function() {
+ $('i.table-group-collapsible')
+ .click(function(){
+ $(this).closest('tr.group.collapsible').nextUntil('tr.group.collapsible').toggle();
+ $(this).toggleClass('fa-minus-square-o');
+ $(this).toggleClass('fa-plus-square-o');
+ });
+
+ $('i.table-openall-collapsible')
+ .click(function(){
+ $('tr.group.collapsible').first().find('i').addClass('fa-minus-square-o');
+ $('tr.group.collapsible').first().find('i').removeClass('fa-plus-square-o');
+ $('tr.group.collapsible').first().nextAll('tr:not(tr.group.collapsible)').show();
+ $('tr.group.collapsible').first().nextAll('tr.group.collapsible').find('i').addClass('fa-minus-square-o');
+ $('tr.group.collapsible').first().nextAll('tr.group.collapsible').find('i').removeClass('fa-plus-square-o');
+ });
+
+ $('i.table-closeall-collapsible')
+ .click(function(){
+ $('tr.group.collapsible').first().find('i').addClass('fa-plus-square-o');
+ $('tr.group.collapsible').first().find('i').removeClass('fa-minus-square-o');
+ $('tr.group.collapsible').first().nextAll('tr:not(tr.group.collapsible)').hide();
+ $('tr.group.collapsible').first().nextAll('tr.group.collapsible').find('i').addClass('fa-plus-square-o');
+ $('tr.group.collapsible').first().nextAll('tr.group.collapsible').find('i').removeClass('fa-minus-square-o');
+ });
+
+ $( document ).ready(function() {
+ if($('tr.group.collapsible').first().find('i').hasClass('fa-plus-square-o')) {
+ $('tr.group.collapsible').first().nextAll('tr:not(tr.group.collapsible)').hide();
+ }
+ });
+}); \ No newline at end of file