Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions js/alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@

$parent.removeClass('in')

function removeElement() {
$parent.trigger('closed.bs.alert').remove()
function hideElement() {
$parent.trigger('closed.bs.alert').hide()
}

$.support.transition && $parent.hasClass('fade') ?
$parent
.one($.support.transition.end, removeElement)
.one($.support.transition.end, hideElement)
.emulateTransitionEnd(150) :
removeElement()
hideElement()
}


Expand Down
4 changes: 2 additions & 2 deletions js/tests/unit/alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ $(function () {
ok(!alert.hasClass('in'), 'remove .in class on .close click')
})

test("should remove element when clicking .close", function () {
test("should hide element when clicking .close", function () {
$.support.transition = false

var alertHTML = '<div class="alert-message warning fade in">'
Expand All @@ -41,7 +41,7 @@ $(function () {

alert.find('.close').click()

ok(!$('#qunit-fixture').find('.alert-message').length, 'element removed from dom')
ok(!$('#qunit-fixture').find('.alert-message').is(':visible'), 'element hidden')
})

test("should not fire closed when close is prevented", function () {
Expand Down