diff options
| author | Ivan Khalopik <[email protected]> | 2013-06-10 10:31:51 +0300 |
|---|---|---|
| committer | Ivan Khalopik <[email protected]> | 2013-06-10 10:31:51 +0300 |
| commit | e138b0df3a1bcd536cc312d7c4714ff5bc9acd2b (patch) | |
| tree | 2d6f41184d19466d6f9fa016ba521260413435cb /docs/assets/js/bootstrap.js | |
| parent | 3285f4c3062f4a56eaed2461a3128a2e6a3ba9cc (diff) | |
| parent | d74a9634b0cb21a712f5e805c7a21132dc9bee5e (diff) | |
| download | bootstrap-e138b0df3a1bcd536cc312d7c4714ff5bc9acd2b.tar.xz bootstrap-e138b0df3a1bcd536cc312d7c4714ff5bc9acd2b.zip | |
Merge remote-tracking branch 'bootstrap/3.0.0-wip' into 3.0.0-wip
Diffstat (limited to 'docs/assets/js/bootstrap.js')
| -rw-r--r-- | docs/assets/js/bootstrap.js | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/docs/assets/js/bootstrap.js b/docs/assets/js/bootstrap.js index b7082dc21..744b27676 100644 --- a/docs/assets/js/bootstrap.js +++ b/docs/assets/js/bootstrap.js @@ -434,7 +434,7 @@ // ================= $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) { - var $this = $(this), href + var $this = $(this), href var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 var options = $.extend({}, $target.data(), $this.data()) var slideIndex @@ -442,12 +442,19 @@ $target.carousel(options) if (slideIndex = $this.attr('data-slide-to')) { - $target.data('bs-carousel').pause().to(slideIndex).cycle() + $target.data('bs.carousel').pause().to(slideIndex).cycle() } e.preventDefault() }) + $(window).on('load', function () { + $('[data-ride="carousel"]').each(function () { + var $carousel = $(this) + $carousel.carousel($carousel.data()) + }) + }) + }(window.jQuery); /* ======================================================================== * Bootstrap: collapse.js v3.0.0 @@ -865,18 +872,18 @@ Modal.prototype.enforceFocus = function () { $(document) .off('focusin.bs.modal') // guard against infinite focus loop - .on('focusin.bs.modal', function (e) { - if (this.$element[0] !== e.target && !this.$element.has(e.target).length) { - this.$element.focus() - } - }, this) + .on('focusin.bs.modal', $.proxy(function (e) { + if (this.$element[0] !== e.target && !this.$element.has(e.target).length) { + this.$element.focus() + } + }, this)) } Modal.prototype.escape = function () { if (this.isShown && this.options.keyboard) { - this.$element.on('keyup.dismiss.bs.modal', function ( e ) { + this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) { e.which == 27 && this.hide() - }, this) + }, this)) } else if (!this.isShown) { this.$element.off('keyup.dismiss.bs.modal') } @@ -1093,7 +1100,7 @@ return options } - Tooltip.prototype.enter = function (e) { + Tooltip.prototype.enter = function (obj) { var defaults = this.getDefaults() var options = {} @@ -1101,26 +1108,29 @@ if (defaults[key] != value) options[key] = value }) - var self = $(e.currentTarget)[this.type](options).data('bs.' + this.type) + var self = obj instanceof this.constructor ? + obj : $(obj.currentTarget)[this.type](options).data('bs.' + this.type) if (!self.options.delay || !self.options.delay.show) return self.show() clearTimeout(this.timeout) self.hoverState = 'in' - this.timeout = setTimeout(function() { + this.timeout = setTimeout(function () { if (self.hoverState == 'in') self.show() }, self.options.delay.show) } - Tooltip.prototype.leave = function (e) { - var self = $(e.currentTarget)[this.type](this._options).data('bs.' + this.type) + Tooltip.prototype.leave = function (obj) { + var self = obj instanceof this.constructor ? + obj : $(obj.currentTarget)[this.type](this._options).data('bs.' + this.type) + + clearTimeout(this.timeout) - if (this.timeout) clearTimeout(this.timeout) if (!self.options.delay || !self.options.delay.hide) return self.hide() self.hoverState = 'out' - this.timeout = setTimeout(function() { + this.timeout = setTimeout(function () { if (self.hoverState == 'out') self.hide() }, self.options.delay.hide) } @@ -1317,7 +1327,7 @@ Tooltip.prototype.toggle = function (e) { var self = e ? $(e.currentTarget)[this.type](this._options).data('bs.' + this.type) : this - self.tip().hasClass('in') ? self.hide() : self.show() + self.tip().hasClass('in') ? self.leave(self) : self.enter(self) } Tooltip.prototype.destroy = function () { |
