vendor/assets/javascripts/collapse.js in flashgrid-1.0.20 vs vendor/assets/javascripts/collapse.js in flashgrid-1.0.21

- old
+ new

@@ -45,11 +45,12 @@ .addClass('collapsing') [dimension](0) this.transitioning = 1 - var complete = function () { + var complete = function (e) { + if (e && e.target != this.$element[0]) return this.$element .removeClass('collapsing') .addClass('collapse in') [dimension]('auto') this.transitioning = 0 @@ -84,11 +85,12 @@ .removeClass('collapse') .removeClass('in') this.transitioning = 1 - var complete = function () { + var complete = function (e) { + if (e && e.target != this.$element[0]) return this.transitioning = 0 this.$element .trigger('hidden.bs.collapse') .removeClass('collapsing') .addClass('collapse') @@ -137,11 +139,11 @@ // COLLAPSE DATA-API // ================= - $(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) { + $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) { var $this = $(this), href var target = $this.attr('data-target') || e.preventDefault() || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 var $target = $(target) @@ -149,10 +151,10 @@ var option = data ? 'toggle' : $this.data() var parent = $this.attr('data-parent') var $parent = parent && $(parent) if (!data || !data.transitioning) { - if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed') + if ($parent) $parent.find('[data-toggle="collapse"][data-parent="' + parent + '"]').not($this).addClass('collapsed') $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed') } $target.collapse(option) }) \ No newline at end of file