(function ($)
{
    var constants = {
        notification: {
            show: {
                duration: 'slow',
                delay: 500
            },
            hide: {
                duration: 'slow',
                delay: 5000
            }
        }
    },
    properties = {
    },
            methods = {
                init: function ()
                {
                    $(window).load(methods.loaded);
                    $('.table').dataTable();
                    $('.modal').on('hide.bs.modal', methods.hideModal);
                    $('[data-toggle="collapse"]').on('click', methods.collapse).each(methods.prepareCollapse);
                    $('.alert-notifications .alert').each(methods.showNotification);
                },
                loaded: function ()
                {
                    $('body').addClass('loaded');
                },
                prepareCollapse: function()
                {
                    var $this = $(this), target = $($this.attr('data-target'));
                    if (target.hasClass('in')) {
                        $this.data('originalTitle', $this.html());
                        $this.html('<span class="glyphicon glyphicon-minus" aria-hidden="true" /> Hide');
                    }
                },
                collapse: function ()
                {
                    var $this = $(this), target = $($this.attr('data-target'));
                    if (target.hasClass('collapsing')) {
                        return;
                    }
                    
                    var originalTitle = $this.data('originalTitle');
                    if (originalTitle && target.hasClass('in')) {
                        $this.html(originalTitle);
                        $this.data('originalTitle', null);
                    } else if (!originalTitle) {
                        $this.data('originalTitle', $this.html());
                        $this.html('<span class="glyphicon glyphicon-minus" aria-hidden="true" /> Hide');
                    }
                },
                hideModal: function ()
                {
                    var href = $('.btn-cancel', this).attr('data-href');
                    if (href) {
                        window.location.href = href;
                    }
                },
                showNotification: function ()
                {
                    $(this).delay(constants.notification.show.delay).fadeIn(
                            constants.notification.show.duration,
                            methods.hideNotification
                            ).hover(
                            methods.hoverNotification,
                            methods.hideNotification
                            );
                },
                hideNotification: function ()
                {
                    $(this).delay(constants.notification.hide.delay).fadeOut(
                            constants.notification.hide.duration
                            );
                },
                hoverNotification: function ()
                {
                    $(this).stop(true).show();
                }
            };

    $(document).ready(methods.init);
})(jQuery);
@@ -608,39 +608,26 @@
 se%22%5D
-').on('click', methods.collapse
+%5Bvalue!=%22Cancel%22%5D'
 ).ea
@@ -969,37 +969,38 @@
             var 
-$this
+button
  = $(this), targ
@@ -998,37 +998,38 @@
 is), target = $(
-$this
+button
 .attr('data-targ
@@ -1060,67 +1060,14 @@
     
-if (target.hasClass('in')) %7B%0D%0A                        $this
+button
 .dat
@@ -1077,37 +1077,38 @@
 originalTitle', 
-$this
+button
 .html());%0D%0A     
@@ -1126,93 +1126,19 @@
     
-    $this.html('%3Cspan class=%22glyphicon glyphicon-minus%22 aria-hidden=%22true%22 /%3E Hide');
+target.on(%7B
 %0D%0A  
@@ -1159,55 +1159,31 @@
     
-%7D%0D%0A
     
-            %7D,%0D%0A                
+'hidden.bs.
 collapse
 : fu
@@ -1174,24 +1174,25 @@
 .bs.collapse
+'
 : function (
@@ -1202,32 +1202,40 @@
                 
+     
+   
 %7B%0D%0A             
@@ -1245,125 +1245,88 @@
     
-var $this = $(this), target = $($this.attr('data-target'));%0D%0A                    if (target.hasClass('collapsing')) %7B
+        button.html(button.data('originalTitle'));%0D%0A                            
 %0D%0A  
@@ -1351,17 +1351,15 @@
     
-return;%0D%0A
+%7D,%0D%0A   
     
@@ -1366,33 +1366,65 @@
                 
-%7D
+ 'shown.bs.collapse': function ()
 %0D%0A              
@@ -1421,32 +1421,37 @@
                 
+ 
+   %7B
 %0D%0A              
@@ -1460,282 +1460,219 @@
     
-var originalTitle = $this.data('originalTitle');%0D%0A                    if (originalTitle && target.hasClass('in')) %7B%0D%0A                        $this.html(originalTitle);%0D%0A                        $this.data('originalTitle', null);%0D%0A                    %7D else if (!originalTitle
+        button.html('%3Cspan class=%22glyphicon glyphicon-minus%22 aria-hidden=%22true%22 /%3E Hide');%0D%0A                        %7D%0D%0A                    %7D);%0D%0A                    %0D%0A                    if (target.hasClass('in')
 ) %7B%0D
@@ -1696,21 +1696,22 @@
         
-$this
+button
 .data('o
@@ -1725,21 +1725,22 @@
 Title', 
-$this
+button
 .html())
@@ -1770,13 +1770,14 @@
     
-$this
+button
 .htm

Fix collapsible