fixed issue where an updated alert didn't contain changes to the clickfn, closes #2798

This commit is contained in:
Julian Lam
2015-02-26 09:14:28 -05:00
parent 339619fc9d
commit a2c6f58782

View File

@@ -77,6 +77,19 @@ define('alerts', function() {
alert.children().fadeIn(100);
alert.html(translatedHTML);
});
// Handle changes in the clickfn
alert.off('click').removeClass('pointer');
if (typeof params.clickfn === 'function') {
alert
.addClass('pointer')
.on('click', function (e) {
if(!$(e.target).is('.close')) {
params.clickfn();
}
fadeOut(alert);
});
}
}
function fadeOut(alert) {