Commit fdb7121f authored by Mark Otto's avatar Mark Otto

Merge branch '3.0.0-wip' of github.com:twbs/bootstrap into 3.0.0-wip

parents 3bcadfc2 484d51ce
...@@ -851,7 +851,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") } ...@@ -851,7 +851,7 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
var Modal = function (element, options) { var Modal = function (element, options) {
this.options = options this.options = options
this.$element = $(element).on('click.dismiss.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)) this.$element = $(element)
this.$backdrop = this.$backdrop =
this.isShown = null this.isShown = null
...@@ -880,6 +880,8 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") } ...@@ -880,6 +880,8 @@ if (!jQuery) { throw new Error("Bootstrap requires jQuery") }
this.escape() this.escape()
this.$element.on('click.dismiss.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
this.backdrop(function () { this.backdrop(function () {
var transition = $.support.transition && that.$element.hasClass('fade') var transition = $.support.transition && that.$element.hasClass('fade')
......
This diff is collapsed.
...@@ -1104,7 +1104,7 @@ $('#myTooltip').on('hidden.bs.tooltip', function () { ...@@ -1104,7 +1104,7 @@ $('#myTooltip').on('hidden.bs.tooltip', function () {
<td>string | false</td> <td>string | false</td>
<td>false</td> <td>false</td>
<td> <td>
<p>Appends the popover to a specific element. Example: <code>container: 'body'</code></p> <p>Appends the popover to a specific element. Example: <code>container: 'body'</code>. This option is particularly useful inthat it allows you to position the popover in the flow of the document near the triggering element - which will prevent the popover from floating away from the triggering element during a window resize.</p>
</td> </td>
</tr> </tr>
</tbody> </tbody>
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
var Modal = function (element, options) { var Modal = function (element, options) {
this.options = options this.options = options
this.$element = $(element).on('click.dismiss.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)) this.$element = $(element)
this.$backdrop = this.$backdrop =
this.isShown = null this.isShown = null
...@@ -54,6 +54,8 @@ ...@@ -54,6 +54,8 @@
this.escape() this.escape()
this.$element.on('click.dismiss.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
this.backdrop(function () { this.backdrop(function () {
var transition = $.support.transition && that.$element.hasClass('fade') var transition = $.support.transition && that.$element.hasClass('fade')
......
...@@ -174,4 +174,23 @@ $(function () { ...@@ -174,4 +174,23 @@ $(function () {
}) })
.modal("show") .modal("show")
}) })
test("should close reopened modal with [data-dismiss=modal] click", function () {
stop()
$.support.transition = false
var div = $("<div id='modal-test'><div class='contents'><div id='close' data-dismiss='modal'></div></div></div>")
div
.bind("shown.bs.modal", function () {
$('#close').click()
ok(!$('#modal-test').is(":visible"), 'modal hidden')
})
.one("hidden.bs.modal", function() {
div.one('hidden.bs.modal', function () {
start()
}).modal("show")
})
.modal("show")
div.remove()
})
}) })
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment