From 637808f2ee4f4b43897b115fa736353621639681 Mon Sep 17 00:00:00 2001 From: Ross Nye Date: Wed, 23 Apr 2014 17:34:32 +1000 Subject: [PATCH 1/2] fires closed.bs.alert *after* DOM detach() fires closed.bs.alert *after* element is removed from DOM. Previously it fired while the element was still attached. --- js/alert.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/alert.js b/js/alert.js index 516fe4ff58..1072325851 100644 --- a/js/alert.js +++ b/js/alert.js @@ -42,7 +42,7 @@ $parent.removeClass('in') function removeElement() { - $parent.trigger('closed.bs.alert').remove() + $parent.detach().trigger('closed.bs.alert') } $.support.transition && $parent.hasClass('fade') ? From 73f7acc01b7e2535c615045322822c617af1357b Mon Sep 17 00:00:00 2001 From: Ross Nye Date: Wed, 30 Apr 2014 13:12:31 +1000 Subject: [PATCH 2/2] Update alert.js Added call to remove() after event fires to clean up data as per discussion at #12379 --- js/alert.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/alert.js b/js/alert.js index 1072325851..2738145c28 100644 --- a/js/alert.js +++ b/js/alert.js @@ -42,7 +42,8 @@ $parent.removeClass('in') function removeElement() { - $parent.detach().trigger('closed.bs.alert') + // detach from parent, fire event then clean up data + $parent.detach().trigger('closed.bs.alert').remove() } $.support.transition && $parent.hasClass('fade') ?