summaryrefslogtreecommitdiff
path: root/bower_components/bootstrap/js
diff options
context:
space:
mode:
Diffstat (limited to 'bower_components/bootstrap/js')
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/.jshintrc2
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/affix.js0
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/alert.js0
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/button.js6
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/carousel.js8
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/collapse.js4
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/dropdown.js0
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/modal.js35
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/popover.js12
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/scrollspy.js0
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/tab.js0
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/tests/index.html0
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/tests/phantom.js0
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/tests/server.js0
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/tests/unit/affix.js0
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/tests/unit/alert.js0
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/tests/unit/button.js0
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/tests/unit/carousel.js0
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/tests/unit/collapse.js35
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/tests/unit/dropdown.js12
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/tests/unit/modal.js301
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/tests/unit/phantom.js0
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/tests/unit/popover.js0
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/tests/unit/scrollspy.js0
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/tests/unit/tab.js0
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/tests/unit/tooltip.js0
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/tests/unit/transition.js0
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/tests/vendor/jquery.js0
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/tests/vendor/qunit.css0
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/tests/vendor/qunit.js0
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/tooltip.js60
-rwxr-xr-x[-rw-r--r--]bower_components/bootstrap/js/transition.js4
32 files changed, 283 insertions, 196 deletions
diff --git a/bower_components/bootstrap/js/.jshintrc b/bower_components/bootstrap/js/.jshintrc
index 70e6c579..94c520d5 100644..100755
--- a/bower_components/bootstrap/js/.jshintrc
+++ b/bower_components/bootstrap/js/.jshintrc
@@ -3,9 +3,11 @@
"laxcomma" : true,
"laxbreak" : true,
"browser" : true,
+ "eqeqeq" : false,
"eqnull" : true,
"debug" : true,
"devel" : true,
+ "curly" : false,
"boss" : true,
"expr" : true,
"asi" : true
diff --git a/bower_components/bootstrap/js/affix.js b/bower_components/bootstrap/js/affix.js
index c7be96e1..c7be96e1 100644..100755
--- a/bower_components/bootstrap/js/affix.js
+++ b/bower_components/bootstrap/js/affix.js
diff --git a/bower_components/bootstrap/js/alert.js b/bower_components/bootstrap/js/alert.js
index 663029ed..663029ed 100644..100755
--- a/bower_components/bootstrap/js/alert.js
+++ b/bower_components/bootstrap/js/alert.js
diff --git a/bower_components/bootstrap/js/button.js b/bower_components/bootstrap/js/button.js
index 539e9fea..fc73b555 100644..100755
--- a/bower_components/bootstrap/js/button.js
+++ b/bower_components/bootstrap/js/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/bower_components/bootstrap/js/carousel.js b/bower_components/bootstrap/js/carousel.js
index d4bcb88b..d8c4c243 100644..100755
--- a/bower_components/bootstrap/js/carousel.js
+++ b/bower_components/bootstrap/js/carousel.js
@@ -41,6 +41,7 @@
Carousel.DEFAULTS = {
interval: 5000
, pause: 'hover'
+ , wrap: true
}
Carousel.prototype.cycle = function (e) {
@@ -105,12 +106,15 @@
var fallback = type == 'next' ? 'first' : 'last'
var that = this
+ if (!$next.length) {
+ if (!this.options.wrap) return
+ $next = this.$element.find('.item')[fallback]()
+ }
+
this.sliding = true
isCycling && this.pause()
- $next = $next.length ? $next : this.$element.find('.item')[fallback]()
-
var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
if ($next.hasClass('active')) return
diff --git a/bower_components/bootstrap/js/collapse.js b/bower_components/bootstrap/js/collapse.js
index 34ac3c7f..92cc0bc7 100644..100755
--- a/bower_components/bootstrap/js/collapse.js
+++ b/bower_components/bootstrap/js/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/bower_components/bootstrap/js/dropdown.js b/bower_components/bootstrap/js/dropdown.js
index 69bbd802..69bbd802 100644..100755
--- a/bower_components/bootstrap/js/dropdown.js
+++ b/bower_components/bootstrap/js/dropdown.js
diff --git a/bower_components/bootstrap/js/modal.js b/bower_components/bootstrap/js/modal.js
index 83095e8f..e0f8b7a0 100644..100755
--- a/bower_components/bootstrap/js/modal.js
+++ b/bower_components/bootstrap/js/modal.js
@@ -29,7 +29,7 @@
this.$backdrop =
this.isShown = null
- if (this.options.remote) this.$element.find('.modal-body').load(this.options.remote)
+ if (this.options.remote) this.$element.load(this.options.remote)
}
Modal.DEFAULTS = {
@@ -38,13 +38,13 @@
, show: true
}
- Modal.prototype.toggle = function () {
- return this[!this.isShown ? 'show' : 'hide']()
+ Modal.prototype.toggle = function (_relatedTarget) {
+ return this[!this.isShown ? 'show' : 'hide'](_relatedTarget)
}
- Modal.prototype.show = function () {
+ Modal.prototype.show = function (_relatedTarget) {
var that = this
- var e = $.Event('show.bs.modal')
+ var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
this.$element.trigger(e)
@@ -73,13 +73,15 @@
that.enforceFocus()
+ var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
+
transition ?
that.$element
.one($.support.transition.end, function () {
- that.$element.focus().trigger('shown.bs.modal')
+ that.$element.focus().trigger(e)
})
.emulateTransitionEnd(300) :
- that.$element.focus().trigger('shown.bs.modal')
+ that.$element.focus().trigger(e)
})
}
@@ -101,6 +103,7 @@
this.$element
.removeClass('in')
.attr('aria-hidden', true)
+ .off('click.dismiss.modal')
$.support.transition && this.$element.hasClass('fade') ?
this.$element
@@ -153,7 +156,7 @@
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
.appendTo(document.body)
- this.$element.on('click', $.proxy(function (e) {
+ this.$element.on('click.dismiss.modal', $.proxy(function (e) {
if (e.target !== e.currentTarget) return
this.options.backdrop == 'static'
? this.$element[0].focus.call(this.$element[0])
@@ -192,15 +195,15 @@
var old = $.fn.modal
- $.fn.modal = function (option) {
+ $.fn.modal = function (option, _relatedTarget) {
return this.each(function () {
var $this = $(this)
var data = $this.data('bs.modal')
var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
- if (typeof option == 'string') data[option]()
- else if (options.show) data.show()
+ if (typeof option == 'string') data[option](_relatedTarget)
+ else if (options.show) data.show(_relatedTarget)
})
}
@@ -223,19 +226,19 @@
var $this = $(this)
var href = $this.attr('href')
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
- var option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data())
+ var option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
e.preventDefault()
$target
- .modal(option)
+ .modal(option, this)
.one('hide', function () {
$this.is(':visible') && $this.focus()
})
})
- var $body = $(document.body)
- .on('shown.bs.modal', '.modal', function () { $body.addClass('modal-open') })
- .on('hidden.bs.modal', '.modal', function () { $body.removeClass('modal-open') })
+ $(document)
+ .on('shown.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') })
+ .on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') })
}(window.jQuery);
diff --git a/bower_components/bootstrap/js/popover.js b/bower_components/bootstrap/js/popover.js
index 7abca8ac..ecd37ac2 100644..100755
--- a/bower_components/bootstrap/js/popover.js
+++ b/bower_components/bootstrap/js/popover.js
@@ -58,7 +58,9 @@
$tip.removeClass('fade top bottom left right in')
- $tip.find('.popover-title:empty').hide()
+ // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
+ // this manually by checking the contents.
+ if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
}
Popover.prototype.hasContent = function () {
@@ -75,15 +77,15 @@
o.content)
}
+ Popover.prototype.arrow = function () {
+ return this.$arrow = this.$arrow || this.tip().find('.arrow')
+ }
+
Popover.prototype.tip = function () {
if (!this.$tip) this.$tip = $(this.options.template)
return this.$tip
}
- Popover.prototype.destroy = function () {
- this.hide().$element.off('.' + this.type).removeData(this.type)
- }
-
// POPOVER PLUGIN DEFINITION
// =========================
diff --git a/bower_components/bootstrap/js/scrollspy.js b/bower_components/bootstrap/js/scrollspy.js
index 10f95f24..10f95f24 100644..100755
--- a/bower_components/bootstrap/js/scrollspy.js
+++ b/bower_components/bootstrap/js/scrollspy.js
diff --git a/bower_components/bootstrap/js/tab.js b/bower_components/bootstrap/js/tab.js
index e1c15592..e1c15592 100644..100755
--- a/bower_components/bootstrap/js/tab.js
+++ b/bower_components/bootstrap/js/tab.js
diff --git a/bower_components/bootstrap/js/tests/index.html b/bower_components/bootstrap/js/tests/index.html
index 501bf38f..501bf38f 100644..100755
--- a/bower_components/bootstrap/js/tests/index.html
+++ b/bower_components/bootstrap/js/tests/index.html
diff --git a/bower_components/bootstrap/js/tests/phantom.js b/bower_components/bootstrap/js/tests/phantom.js
index a9047db4..a9047db4 100644..100755
--- a/bower_components/bootstrap/js/tests/phantom.js
+++ b/bower_components/bootstrap/js/tests/phantom.js
diff --git a/bower_components/bootstrap/js/tests/server.js b/bower_components/bootstrap/js/tests/server.js
index f0def8f3..f0def8f3 100644..100755
--- a/bower_components/bootstrap/js/tests/server.js
+++ b/bower_components/bootstrap/js/tests/server.js
diff --git a/bower_components/bootstrap/js/tests/unit/affix.js b/bower_components/bootstrap/js/tests/unit/affix.js
index b74bc51e..b74bc51e 100644..100755
--- a/bower_components/bootstrap/js/tests/unit/affix.js
+++ b/bower_components/bootstrap/js/tests/unit/affix.js
diff --git a/bower_components/bootstrap/js/tests/unit/alert.js b/bower_components/bootstrap/js/tests/unit/alert.js
index 98b10059..98b10059 100644..100755
--- a/bower_components/bootstrap/js/tests/unit/alert.js
+++ b/bower_components/bootstrap/js/tests/unit/alert.js
diff --git a/bower_components/bootstrap/js/tests/unit/button.js b/bower_components/bootstrap/js/tests/unit/button.js
index 41ddb5c2..41ddb5c2 100644..100755
--- a/bower_components/bootstrap/js/tests/unit/button.js
+++ b/bower_components/bootstrap/js/tests/unit/button.js
diff --git a/bower_components/bootstrap/js/tests/unit/carousel.js b/bower_components/bootstrap/js/tests/unit/carousel.js
index badf0886..badf0886 100644..100755
--- a/bower_components/bootstrap/js/tests/unit/carousel.js
+++ b/bower_components/bootstrap/js/tests/unit/carousel.js
diff --git a/bower_components/bootstrap/js/tests/unit/collapse.js b/bower_components/bootstrap/js/tests/unit/collapse.js
index 73799c75..11b2cf83 100644..100755
--- a/bower_components/bootstrap/js/tests/unit/collapse.js
+++ b/bower_components/bootstrap/js/tests/unit/collapse.js
@@ -126,4 +126,39 @@ $(function () {
target3.click()
})
+ test("should allow dots in data-parent", function () {
+ $.support.transition = false
+ stop()
+
+ var accordion = $('<div class="accordion"><div class="accordion-group"></div><div class="accordion-group"></div><div class="accordion-group"></div></div>')
+ .appendTo($('#qunit-fixture'))
+
+ var target1 = $('<a data-toggle="collapse" href="#body1" data-parent=".accordion"></a>')
+ .appendTo(accordion.find('.accordion-group').eq(0))
+
+ var collapsible1 = $('<div id="body1" class="in"></div>')
+ .appendTo(accordion.find('.accordion-group').eq(0))
+
+ var target2 = $('<a class="collapsed" data-toggle="collapse" href="#body2" data-parent=".accordion"></a>')
+ .appendTo(accordion.find('.accordion-group').eq(1))
+
+ var collapsible2 = $('<div id="body2"></div>')
+ .appendTo(accordion.find('.accordion-group').eq(1))
+
+ var target3 = $('<a class="collapsed" data-toggle="collapse" href="#body3" data-parent=".accordion"></a>')
+ .appendTo(accordion.find('.accordion-group').eq(2))
+
+ var collapsible3 = $('<div id="body3"></div>')
+ .appendTo(accordion.find('.accordion-group').eq(2))
+ .on('show.bs.collapse', function () {
+ ok(target1.hasClass('collapsed'))
+ ok(target2.hasClass('collapsed'))
+ ok(!target3.hasClass('collapsed'))
+
+ start()
+ })
+
+ target3.click()
+ })
+
})
diff --git a/bower_components/bootstrap/js/tests/unit/dropdown.js b/bower_components/bootstrap/js/tests/unit/dropdown.js
index e45bd0a4..02256965 100644..100755
--- a/bower_components/bootstrap/js/tests/unit/dropdown.js
+++ b/bower_components/bootstrap/js/tests/unit/dropdown.js
@@ -165,9 +165,9 @@ $(function () {
.appendTo('#qunit-fixture')
.find('[data-toggle="dropdown"]')
.dropdown()
-
+
stop()
-
+
dropdown
.parent('.dropdown')
.bind('show.bs.dropdown', function () {
@@ -177,7 +177,7 @@ $(function () {
ok(true, 'hide was called')
start()
})
-
+
dropdown.click()
$(document.body).click()
})
@@ -199,9 +199,9 @@ $(function () {
.appendTo('#qunit-fixture')
.find('[data-toggle="dropdown"]')
.dropdown()
-
+
stop()
-
+
dropdown
.parent('.dropdown')
.bind('shown.bs.dropdown', function () {
@@ -211,7 +211,7 @@ $(function () {
ok(true, 'hide was called')
start()
})
-
+
dropdown.click()
$(document.body).click()
})
diff --git a/bower_components/bootstrap/js/tests/unit/modal.js b/bower_components/bootstrap/js/tests/unit/modal.js
index 90762ea9..2c610d83 100644..100755
--- a/bower_components/bootstrap/js/tests/unit/modal.js
+++ b/bower_components/bootstrap/js/tests/unit/modal.js
@@ -1,156 +1,177 @@
$(function () {
- module("modal")
+ module("modal")
- test("should provide no conflict", function () {
- var modal = $.fn.modal.noConflict()
- ok(!$.fn.modal, 'modal was set back to undefined (org value)')
- $.fn.modal = modal
- })
+ test("should provide no conflict", function () {
+ var modal = $.fn.modal.noConflict()
+ ok(!$.fn.modal, 'modal was set back to undefined (org value)')
+ $.fn.modal = modal
+ })
- test("should be defined on jquery object", function () {
- var div = $("<div id='modal-test'></div>")
- ok(div.modal, 'modal method is defined')
- })
+ test("should be defined on jquery object", function () {
+ var div = $("<div id='modal-test'></div>")
+ ok(div.modal, 'modal method is defined')
+ })
- test("should return element", function () {
- var div = $("<div id='modal-test'></div>")
- ok(div.modal() == div, 'document.body returned')
- $('#modal-test').remove()
- })
+ test("should return element", function () {
+ var div = $("<div id='modal-test'></div>")
+ ok(div.modal() == div, 'document.body returned')
+ $('#modal-test').remove()
+ })
- test("should expose defaults var for settings", function () {
- ok($.fn.modal.Constructor.DEFAULTS, 'default object exposed')
- })
+ test("should expose defaults var for settings", function () {
+ ok($.fn.modal.Constructor.DEFAULTS, 'default object exposed')
+ })
- test("should insert into dom when show method is called", function () {
- stop()
- $.support.transition = false
- $("<div id='modal-test'></div>")
- .on("shown.bs.modal", function () {
- ok($('#modal-test').length, 'modal inserted into dom')
- $(this).remove()
- start()
- })
- .modal("show")
- })
+ test("should insert into dom when show method is called", function () {
+ stop()
+ $.support.transition = false
+ $("<div id='modal-test'></div>")
+ .on("shown.bs.modal", function () {
+ ok($('#modal-test').length, 'modal inserted into dom')
+ $(this).remove()
+ start()
+ })
+ .modal("show")
+ })
- test("should fire show event", function () {
- stop()
- $.support.transition = false
- $("<div id='modal-test'></div>")
- .on("show.bs.modal", function () {
- ok(true, "show was called")
- })
- .on("shown.bs.modal", function () {
- $(this).remove()
- start()
- })
- .modal("show")
- })
+ test("should fire show event", function () {
+ stop()
+ $.support.transition = false
+ $("<div id='modal-test'></div>")
+ .on("show.bs.modal", function () {
+ ok(true, "show was called")
+ })
+ .on("shown.bs.modal", function () {
+ $(this).remove()
+ start()
+ })
+ .modal("show")
+ })
- test("should not fire shown when default prevented", function () {
- stop()
- $.support.transition = false
- $("<div id='modal-test'></div>")
- .on("show.bs.modal", function (e) {
- e.preventDefault()
- ok(true, "show was called")
- start()
- })
- .on("shown.bs.modal", function () {
- ok(false, "shown was called")
- })
- .modal("show")
- })
+ test("should not fire shown when default prevented", function () {
+ stop()
+ $.support.transition = false
+ $("<div id='modal-test'></div>")
+ .on("show.bs.modal", function (e) {
+ e.preventDefault()
+ ok(true, "show was called")
+ start()
+ })
+ .on("shown.bs.modal", function () {
+ ok(false, "shown was called")
+ })
+ .modal("show")
+ })
- test("should hide modal when hide is called", function () {
- stop()
- $.support.transition = false
+ test("should hide modal when hide is called", function () {
+ stop()
+ $.support.transition = false
- $("<div id='modal-test'></div>")
- .on("shown.bs.modal", function () {
- ok($('#modal-test').is(":visible"), 'modal visible')
- ok($('#modal-test').length, 'modal inserted into dom')
- $(this).modal("hide")
- })
- .on("hidden.bs.modal", function() {
- ok(!$('#modal-test').is(":visible"), 'modal hidden')
- $('#modal-test').remove()
- start()
- })
- .modal("show")
- })
+ $("<div id='modal-test'></div>")
+ .on("shown.bs.modal", function () {
+ ok($('#modal-test').is(":visible"), 'modal visible')
+ ok($('#modal-test').length, 'modal inserted into dom')
+ $(this).modal("hide")
+ })
+ .on("hidden.bs.modal", function() {
+ ok(!$('#modal-test').is(":visible"), 'modal hidden')
+ $('#modal-test').remove()
+ start()
+ })
+ .modal("show")
+ })
- test("should toggle when toggle is called", function () {
- stop()
- $.support.transition = false
- var div = $("<div id='modal-test'></div>")
- div
- .on("shown.bs.modal", function () {
- ok($('#modal-test').is(":visible"), 'modal visible')
- ok($('#modal-test').length, 'modal inserted into dom')
- div.modal("toggle")
- })
- .on("hidden.bs.modal", function() {
- ok(!$('#modal-test').is(":visible"), 'modal hidden')
- div.remove()
- start()
- })
- .modal("toggle")
- })
+ test("should toggle when toggle is called", function () {
+ stop()
+ $.support.transition = false
+ var div = $("<div id='modal-test'></div>")
+ div
+ .on("shown.bs.modal", function () {
+ ok($('#modal-test').is(":visible"), 'modal visible')
+ ok($('#modal-test').length, 'modal inserted into dom')
+ div.modal("toggle")
+ })
+ .on("hidden.bs.modal", function() {
+ ok(!$('#modal-test').is(":visible"), 'modal hidden')
+ div.remove()
+ start()
+ })
+ .modal("toggle")
+ })
- test("should remove from dom when click [data-dismiss=modal]", function () {
- stop()
- $.support.transition = false
- var div = $("<div id='modal-test'><span class='close' data-dismiss='modal'></span></div>")
- div
- .on("shown.bs.modal", function () {
- ok($('#modal-test').is(":visible"), 'modal visible')
- ok($('#modal-test').length, 'modal inserted into dom')
- div.find('.close').click()
- })
- .on("hidden.bs.modal", function() {
- ok(!$('#modal-test').is(":visible"), 'modal hidden')
- div.remove()
- start()
- })
- .modal("toggle")
- })
+ test("should remove from dom when click [data-dismiss=modal]", function () {
+ stop()
+ $.support.transition = false
+ var div = $("<div id='modal-test'><span class='close' data-dismiss='modal'></span></div>")
+ div
+ .on("shown.bs.modal", function () {
+ ok($('#modal-test').is(":visible"), 'modal visible')
+ ok($('#modal-test').length, 'modal inserted into dom')
+ div.find('.close').click()
+ })
+ .on("hidden.bs.modal", function() {
+ ok(!$('#modal-test').is(":visible"), 'modal hidden')
+ div.remove()
+ start()
+ })
+ .modal("toggle")
+ })
- test("should allow modal close with 'backdrop:false'", function () {
- stop()
- $.support.transition = false
- var div = $("<div>", { id: 'modal-test', "data-backdrop": false })
- div
- .on("shown.bs.modal", function () {
- ok($('#modal-test').is(":visible"), 'modal visible')
- div.modal("hide")
- })
- .on("hidden.bs.modal", function() {
- ok(!$('#modal-test').is(":visible"), 'modal hidden')
- div.remove()
- start()
- })
- .modal("show")
- })
+ test("should allow modal close with 'backdrop:false'", function () {
+ stop()
+ $.support.transition = false
+ var div = $("<div>", { id: 'modal-test', "data-backdrop": false })
+ div
+ .on("shown.bs.modal", function () {
+ ok($('#modal-test').is(":visible"), 'modal visible')
+ div.modal("hide")
+ })
+ .on("hidden.bs.modal", function() {
+ ok(!$('#modal-test').is(":visible"), 'modal hidden')
+ div.remove()
+ start()
+ })
+ .modal("show")
+ })
- test("should close modal when clicking outside of modal-content", function () {
- stop()
- $.support.transition = false
- var div = $("<div id='modal-test'><div class='contents'></div></div>")
- div
- .bind("shown.bs.modal", function () {
- ok($('#modal-test').length, 'modal insterted into dom')
- $('.contents').click()
- ok($('#modal-test').is(":visible"), 'modal visible')
- $('#modal-test').click()
- })
- .bind("hidden.bs.modal", function() {
- ok(!$('#modal-test').is(":visible"), 'modal hidden')
- div.remove()
- start()
- })
- .modal("show")
- })
+ test("should close modal when clicking outside of modal-content", function () {
+ stop()
+ $.support.transition = false
+ var div = $("<div id='modal-test'><div class='contents'></div></div>")
+ div
+ .bind("shown.bs.modal", function () {
+ ok($('#modal-test').length, 'modal insterted into dom')
+ $('.contents').click()
+ ok($('#modal-test').is(":visible"), 'modal visible')
+ $('#modal-test').click()
+ })
+ .bind("hidden.bs.modal", function() {
+ ok(!$('#modal-test').is(":visible"), 'modal hidden')
+ div.remove()
+ start()
+ })
+ .modal("show")
+ })
+
+ test("should trigger hide event once when clicking outside of modal-content", function () {
+ stop()
+ $.support.transition = false
+ var div = $("<div id='modal-test'><div class='contents'></div></div>")
+ var triggered
+ div
+ .bind("shown.bs.modal", function () {
+ triggered = 0
+ $('#modal-test').click()
+ })
+ .one("hidden.bs.modal", function() {
+ div.modal("show")
+ })
+ .bind("hide.bs.modal", function () {
+ triggered += 1
+ ok(triggered === 1, 'modal hide triggered once')
+ start()
+ })
+ .modal("show")
+ })
})
diff --git a/bower_components/bootstrap/js/tests/unit/phantom.js b/bower_components/bootstrap/js/tests/unit/phantom.js
index c584c5a3..c584c5a3 100644..100755
--- a/bower_components/bootstrap/js/tests/unit/phantom.js
+++ b/bower_components/bootstrap/js/tests/unit/phantom.js
diff --git a/bower_components/bootstrap/js/tests/unit/popover.js b/bower_components/bootstrap/js/tests/unit/popover.js
index 767d7986..767d7986 100644..100755
--- a/bower_components/bootstrap/js/tests/unit/popover.js
+++ b/bower_components/bootstrap/js/tests/unit/popover.js
diff --git a/bower_components/bootstrap/js/tests/unit/scrollspy.js b/bower_components/bootstrap/js/tests/unit/scrollspy.js
index 06219a1c..06219a1c 100644..100755
--- a/bower_components/bootstrap/js/tests/unit/scrollspy.js
+++ b/bower_components/bootstrap/js/tests/unit/scrollspy.js
diff --git a/bower_components/bootstrap/js/tests/unit/tab.js b/bower_components/bootstrap/js/tests/unit/tab.js
index aede32ab..aede32ab 100644..100755
--- a/bower_components/bootstrap/js/tests/unit/tab.js
+++ b/bower_components/bootstrap/js/tests/unit/tab.js
diff --git a/bower_components/bootstrap/js/tests/unit/tooltip.js b/bower_components/bootstrap/js/tests/unit/tooltip.js
index ed1bf54b..ed1bf54b 100644..100755
--- a/bower_components/bootstrap/js/tests/unit/tooltip.js
+++ b/bower_components/bootstrap/js/tests/unit/tooltip.js
diff --git a/bower_components/bootstrap/js/tests/unit/transition.js b/bower_components/bootstrap/js/tests/unit/transition.js
index 39c415bc..39c415bc 100644..100755
--- a/bower_components/bootstrap/js/tests/unit/transition.js
+++ b/bower_components/bootstrap/js/tests/unit/transition.js
diff --git a/bower_components/bootstrap/js/tests/vendor/jquery.js b/bower_components/bootstrap/js/tests/vendor/jquery.js
index 32d50cb0..32d50cb0 100644..100755
--- a/bower_components/bootstrap/js/tests/vendor/jquery.js
+++ b/bower_components/bootstrap/js/tests/vendor/jquery.js
diff --git a/bower_components/bootstrap/js/tests/vendor/qunit.css b/bower_components/bootstrap/js/tests/vendor/qunit.css
index aa0445dd..aa0445dd 100644..100755
--- a/bower_components/bootstrap/js/tests/vendor/qunit.css
+++ b/bower_components/bootstrap/js/tests/vendor/qunit.css
diff --git a/bower_components/bootstrap/js/tests/vendor/qunit.js b/bower_components/bootstrap/js/tests/vendor/qunit.js
index b332d705..b332d705 100644..100755
--- a/bower_components/bootstrap/js/tests/vendor/qunit.js
+++ b/bower_components/bootstrap/js/tests/vendor/qunit.js
diff --git a/bower_components/bootstrap/js/tooltip.js b/bower_components/bootstrap/js/tooltip.js
index a954923b..e0732a5a 100644..100755
--- a/bower_components/bootstrap/js/tooltip.js
+++ b/bower_components/bootstrap/js/tooltip.js
@@ -1,6 +1,6 @@
/* ========================================================================
* Bootstrap: tooltip.js v3.0.0
- * http://twbs.github.com/bootstrap/javascript.html#affix
+ * http://twbs.github.com/bootstrap/javascript.html#tooltip
* Inspired by the original jQuery.tipsy by Jason Frame
* ========================================================================
* Copyright 2012 Twitter, Inc.
@@ -64,7 +64,7 @@
var eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
var eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
- this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
+ this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
}
}
@@ -91,16 +91,20 @@
return options
}
- Tooltip.prototype.enter = function (obj) {
- var defaults = this.getDefaults()
+ Tooltip.prototype.getDelegateOptions = function () {
var options = {}
+ var defaults = this.getDefaults()
this._options && $.each(this._options, function (key, value) {
if (defaults[key] != value) options[key] = value
})
+ return options
+ }
+
+ Tooltip.prototype.enter = function (obj) {
var self = obj instanceof this.constructor ?
- obj : $(obj.currentTarget)[this.type](options).data('bs.' + this.type)
+ obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
clearTimeout(self.timeout)
@@ -114,7 +118,7 @@
Tooltip.prototype.leave = function (obj) {
var self = obj instanceof this.constructor ?
- obj : $(obj.currentTarget)[this.type](this._options).data('bs.' + this.type)
+ obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
clearTimeout(self.timeout)
@@ -179,12 +183,9 @@
.addClass(placement)
}
- var tp = placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
- placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
- placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
- /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
+ var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
- this.applyPlacement(tp, placement)
+ this.applyPlacement(calculatedOffset, placement)
this.$element.trigger('shown.bs.' + this.type)
}
}
@@ -196,25 +197,33 @@
var height = $tip[0].offsetHeight
// manually read margins because getBoundingClientRect includes difference
- offset.top = offset.top + parseInt($tip.css('margin-top'), 10)
- offset.left = offset.left + parseInt($tip.css('margin-left'), 10)
+ var marginTop = parseInt($tip.css('margin-top'), 10)
+ var marginLeft = parseInt($tip.css('margin-left'), 10)
+
+ // we must check for NaN for ie 8/9
+ if (isNaN(marginTop)) marginTop = 0
+ if (isNaN(marginLeft)) marginLeft = 0
+
+ offset.top = offset.top + marginTop
+ offset.left = offset.left + marginLeft
$tip
.offset(offset)
.addClass('in')
+ // check to see if placing tip in new offset caused the tip to resize itself
var actualWidth = $tip[0].offsetWidth
var actualHeight = $tip[0].offsetHeight
if (placement == 'top' && actualHeight != height) {
replace = true
- offset.top = offset.top + height - actualHeight
+ offset.top = offset.top + height - actualHeight
}
- if (placement == 'bottom' || placement == 'top') {
+ if (/bottom|top/.test(placement)) {
var delta = 0
- if (offset.left < 0){
+ if (offset.left < 0) {
delta = offset.left * -2
offset.left = 0
@@ -249,6 +258,8 @@
var $tip = this.tip()
var e = $.Event('hide.bs.' + this.type)
+ function complete() { $tip.detach() }
+
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
@@ -257,9 +268,9 @@
$.support.transition && this.$tip.hasClass('fade') ?
$tip
- .one($.support.transition.end, $tip.detach)
+ .one($.support.transition.end, complete)
.emulateTransitionEnd(150) :
- $tip.detach()
+ complete()
this.$element.trigger('hidden.bs.' + this.type)
@@ -285,6 +296,13 @@
}, this.$element.offset())
}
+ Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
+ return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
+ placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
+ placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
+ /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
+ }
+
Tooltip.prototype.getTitle = function () {
var title
var $e = this.$element
@@ -300,8 +318,8 @@
return this.$tip = this.$tip || $(this.options.template)
}
- Tooltip.prototype.arrow =function(){
- return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
+ Tooltip.prototype.arrow = function () {
+ return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')
}
Tooltip.prototype.validate = function () {
@@ -325,7 +343,7 @@
}
Tooltip.prototype.toggle = function (e) {
- var self = e ? $(e.currentTarget)[this.type](this._options).data('bs.' + this.type) : this
+ var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this
self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
}
diff --git a/bower_components/bootstrap/js/transition.js b/bower_components/bootstrap/js/transition.js
index dfb64108..0cdcf9ea 100644..100755
--- a/bower_components/bootstrap/js/transition.js
+++ b/bower_components/bootstrap/js/transition.js
@@ -43,8 +43,8 @@
// http://blog.alexmaccaw.com/css-transitions
$.fn.emulateTransitionEnd = function (duration) {
var called = false, $el = this
- $(this).one('webkitTransitionEnd', function () { called = true })
- var callback = function () { if (!called) $($el).trigger('webkitTransitionEnd') }
+ $(this).one($.support.transition.end, function () { called = true })
+ var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
setTimeout(callback, duration)
return this
}