From 9a77ee67de6d0c63d4a897b0e0e550fee88c3696 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 19 Aug 2013 17:38:01 +0200 Subject: [PATCH] Renamed files, 1:1 like in BS3. --- .../{bootstrap-button.js => button.js} | 6 +- .../{bootstrap-collapse.js => collapse.js} | 4 +- .../{bootstrap-dropdown.js => dropdown.js} | 6 +- .../{bootstrap-modal.js => modal.js} | 43 +++++------ .../{bootstrap-popover.js => popover.js} | 12 ++-- .../bootstrap/{bootstrap-tab.js => tab.js} | 0 .../{bootstrap-tooltip.js => tooltip.js} | 72 ++++++++++++------- ...{bootstrap-transition.js => transition.js} | 2 +- 8 files changed, 87 insertions(+), 58 deletions(-) rename app/assets/javascripts/app/lib/bootstrap/{bootstrap-button.js => button.js} (94%) rename app/assets/javascripts/app/lib/bootstrap/{bootstrap-collapse.js => collapse.js} (97%) rename app/assets/javascripts/app/lib/bootstrap/{bootstrap-dropdown.js => dropdown.js} (97%) rename app/assets/javascripts/app/lib/bootstrap/{bootstrap-modal.js => modal.js} (82%) rename app/assets/javascripts/app/lib/bootstrap/{bootstrap-popover.js => popover.js} (90%) rename app/assets/javascripts/app/lib/bootstrap/{bootstrap-tab.js => tab.js} (100%) rename app/assets/javascripts/app/lib/bootstrap/{bootstrap-tooltip.js => tooltip.js} (81%) rename app/assets/javascripts/app/lib/bootstrap/{bootstrap-transition.js => transition.js} (98%) diff --git a/app/assets/javascripts/app/lib/bootstrap/bootstrap-button.js b/app/assets/javascripts/app/lib/bootstrap/button.js similarity index 94% rename from app/assets/javascripts/app/lib/bootstrap/bootstrap-button.js rename to app/assets/javascripts/app/lib/bootstrap/button.js index 539e9fead..fc73b555f 100644 --- a/app/assets/javascripts/app/lib/bootstrap/bootstrap-button.js +++ b/app/assets/javascripts/app/lib/bootstrap/button.js @@ -56,7 +56,9 @@ var $parent = this.$element.closest('[data-toggle="buttons"]') if ($parent.length) { - var $input = this.$element.find('input').prop('checked', !this.$element.hasClass('active')) + var $input = this.$element.find('input') + .prop('checked', !this.$element.hasClass('active')) + .trigger('change') if ($input.prop('type') === 'radio') $parent.find('.active').removeClass('active') } @@ -72,7 +74,7 @@ $.fn.button = function (option) { return this.each(function () { var $this = $(this) - var data = $this.data('button') + var data = $this.data('bs.button') var options = typeof option == 'object' && option if (!data) $this.data('bs.button', (data = new Button(this, options))) diff --git a/app/assets/javascripts/app/lib/bootstrap/bootstrap-collapse.js b/app/assets/javascripts/app/lib/bootstrap/collapse.js similarity index 97% rename from app/assets/javascripts/app/lib/bootstrap/bootstrap-collapse.js rename to app/assets/javascripts/app/lib/bootstrap/collapse.js index 34ac3c7fa..92cc0bc76 100644 --- a/app/assets/javascripts/app/lib/bootstrap/bootstrap-collapse.js +++ b/app/assets/javascripts/app/lib/bootstrap/collapse.js @@ -48,7 +48,7 @@ this.$element.trigger(startEvent) if (startEvent.isDefaultPrevented()) return - var actives = this.$parent && this.$parent.find('> .accordion-group > .in') + var actives = this.$parent && this.$parent.find('> .panel > .in') if (actives && actives.length) { var hasData = actives.data('bs.collapse') @@ -169,7 +169,7 @@ 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') } diff --git a/app/assets/javascripts/app/lib/bootstrap/bootstrap-dropdown.js b/app/assets/javascripts/app/lib/bootstrap/dropdown.js similarity index 97% rename from app/assets/javascripts/app/lib/bootstrap/bootstrap-dropdown.js rename to app/assets/javascripts/app/lib/bootstrap/dropdown.js index 69bbd802c..6093f11a8 100644 --- a/app/assets/javascripts/app/lib/bootstrap/bootstrap-dropdown.js +++ b/app/assets/javascripts/app/lib/bootstrap/dropdown.js @@ -40,7 +40,7 @@ clearMenus() if (!isActive) { - if ('ontouchstart' in document.documentElement) { + if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { // if mobile we we use a backdrop because click events don't delegate $('