mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-18 13:32:58 +01:00
fixed issue where an updated alert didn't contain changes to the clickfn, closes #2798
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user