diff --git a/docs/assets/js/alert.js b/docs/assets/js/alert.js index 9df950245c..b841b4f5aa 100644 --- a/docs/assets/js/alert.js +++ b/docs/assets/js/alert.js @@ -45,7 +45,7 @@ $parent = $this.hasClass('alert') ? $this : $this.parent() } - $parent.trigger(e = $.Event('bs-close')) + $parent.trigger(e = $.Event('bs:alert:close')) if (e.isDefaultPrevented()) return @@ -79,8 +79,8 @@ $.fn.alert.Constructor = Alert - /* ALERT NO CONFLICT - * ================= */ + // ALERT NO CONFLICT + // ================= $.fn.alert.noConflict = function () { $.fn.alert = old @@ -89,7 +89,7 @@ // ALERT DATA-API - // ============== */ + // ============== $(document).on('click.bs-alert.bs-data-api', dismiss, Alert.prototype.close) diff --git a/docs/assets/js/bootstrap.js b/docs/assets/js/bootstrap.js index 77ed438b8e..a8501d592d 100644 --- a/docs/assets/js/bootstrap.js +++ b/docs/assets/js/bootstrap.js @@ -18,34 +18,31 @@ * ========================================================== */ -!function ($) { +!function ($) { "use strict"; - "use strict"; - - - /* CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) - * ======================================================= */ + // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) + // ============================================================ function transitionEnd() { - var el = document.createElement('bootstrap'); + var el = document.createElement('bootstrap') var transEndEventNames = { - 'WebkitTransition' : 'webkitTransitionEnd' - , 'MozTransition' : 'transitionend' - , 'OTransition' : 'oTransitionEnd otransitionend' - , 'transition' : 'transitionend' - }; + 'WebkitTransition' : 'webkitTransitionEnd' + , 'MozTransition' : 'transitionend' + , 'OTransition' : 'oTransitionEnd otransitionend' + , 'transition' : 'transitionend' + } for (var name in transEndEventNames) { if (el.style[name] !== undefined) { - return { end: transEndEventNames[name] }; + return { end: transEndEventNames[name] } } } } $(function () { - $.support.transition = transitionEnd(); - }); + $.support.transition = transitionEnd() + }) }(window.jQuery); /* ========================================================== @@ -95,7 +92,7 @@ $parent = $this.hasClass('alert') ? $this : $this.parent() } - $parent.trigger(e = $.Event('bs-close')) + $parent.trigger(e = $.Event('bs:alert:close')) if (e.isDefaultPrevented()) return @@ -129,8 +126,8 @@ $.fn.alert.Constructor = Alert - /* ALERT NO CONFLICT - * ================= */ + // ALERT NO CONFLICT + // ================= $.fn.alert.noConflict = function () { $.fn.alert = old @@ -139,7 +136,7 @@ // ALERT DATA-API - // ============== */ + // ============== $(document).on('click.bs-alert.bs-data-api', dismiss, Alert.prototype.close) @@ -362,7 +359,7 @@ $next = $next.length ? $next : this.$element.find('.item')[fallback]() - var e = $.Event('slide', { relatedTarget: $next[0], direction: direction }) + var e = $.Event('bs:carousel:slide', { relatedTarget: $next[0], direction: direction }) if ($next.hasClass('active')) return @@ -410,11 +407,11 @@ $.fn.carousel = function (option) { return this.each(function () { var $this = $(this) - var data = $this.data('carousel') + var data = $this.data('bs-carousel') var options = $.extend({}, Carousel.DEFAULTS, typeof option == 'object' && option) var action = typeof option == 'string' ? option : options.slide - if (!data) $this.data('carousel', (data = new Carousel(this, options))) + if (!data) $this.data('bs-carousel', (data = new Carousel(this, options))) if (typeof option == 'number') data.to(option) else if (action) data[action]() else if (options.interval) data.pause().cycle() @@ -432,6 +429,7 @@ return this } + // CAROUSEL DATA-API // ================= @@ -509,7 +507,7 @@ } this.$element[dimension](0) - this.transition('addClass', $.Event('show'), 'shown') + this.transition('addClass', $.Event('bs:collapse:show'), 'shown') if ($.support.transition) this.$element[dimension](this.$element[0][scroll]) } @@ -518,7 +516,7 @@ if (this.transitioning || !this.$element.hasClass('in')) return var dimension = this.dimension() this.reset(this.$element[dimension]()) - this.transition('removeClass', $.Event('hide'), 'hidden') + this.transition('removeClass', $.Event('bs:collapse:hide'), 'hidden') this.$element[dimension](0) } @@ -626,7 +624,6 @@ !function ($) { "use strict"; - // DROPDOWN CLASS DEFINITION // ========================= @@ -766,207 +763,198 @@ * ========================================================= */ -!function ($) { +!function ($) { "use strict"; - "use strict"; // jshint ;_; - - - /* MODAL CLASS DEFINITION - * ====================== */ + // MODAL CLASS DEFINITION + // ====================== var Modal = function (element, options) { - this.options = options - this.$element = $(element) - .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this)) - this.options.remote && this.$element.find('.modal-body').load(this.options.remote) + this.options = options + this.$element = $(element).delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this)) + this.$backdrop = + this.isShown = null + + if (this.options.remote) this.$element.find('.modal-body').load(this.options.remote) } - Modal.prototype = { - - constructor: Modal - - , toggle: function () { - return this[!this.isShown ? 'show' : 'hide']() - } - - , show: function () { - var that = this - , e = $.Event('show') - - this.$element.trigger(e) - - if (this.isShown || e.isDefaultPrevented()) return - - this.isShown = true - - this.escape() - - this.backdrop(function () { - var transition = $.support.transition && that.$element.hasClass('fade') - - if (!that.$element.parent().length) { - that.$element.appendTo(document.body) //don't move modals dom position - } - - that.$element.show() - - if (transition) { - that.$element[0].offsetWidth // force reflow - } - - that.$element - .addClass('in') - .attr('aria-hidden', false) - - that.enforceFocus() - - transition ? - that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) : - that.$element.focus().trigger('shown') - - }) - } - - , hide: function (e) { - e && e.preventDefault() - - var that = this - - e = $.Event('hide') - - this.$element.trigger(e) - - if (!this.isShown || e.isDefaultPrevented()) return - - this.isShown = false - - this.escape() - - $(document).off('focusin.modal') - - this.$element - .removeClass('in') - .attr('aria-hidden', true) - - $.support.transition && this.$element.hasClass('fade') ? - this.hideWithTransition() : - this.hideModal() - } - - , enforceFocus: function () { - var that = this - $(document).on('focusin.modal', function (e) { - if (that.$element[0] !== e.target && !that.$element.has(e.target).length) { - that.$element.focus() - } - }) - } - - , escape: function () { - var that = this - if (this.isShown && this.options.keyboard) { - this.$element.on('keyup.dismiss.modal', function ( e ) { - e.which == 27 && that.hide() - }) - } else if (!this.isShown) { - this.$element.off('keyup.dismiss.modal') - } - } - - , hideWithTransition: function () { - var that = this - , timeout = setTimeout(function () { - that.$element.off($.support.transition.end) - that.hideModal() - }, 500) - - this.$element.one($.support.transition.end, function () { - clearTimeout(timeout) - that.hideModal() - }) - } - - , hideModal: function () { - var that = this - this.$element.hide() - this.backdrop(function () { - that.removeBackdrop() - that.$element.trigger('hidden') - }) - } - - , removeBackdrop: function () { - this.$backdrop && this.$backdrop.remove() - this.$backdrop = null - } - - , backdrop: function (callback) { - var that = this - , animate = this.$element.hasClass('fade') ? 'fade' : '' - - if (this.isShown && this.options.backdrop) { - var doAnimate = $.support.transition && animate - - this.$backdrop = $('