mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/10270] Recoded some potentially buggy code in phpbb.confirm.
The code before could have removed event handlers defined by other code. PHPBB3-10270
This commit is contained in:
parent
885c2914db
commit
8da463ac9e
1 changed files with 6 additions and 5 deletions
|
@ -124,21 +124,22 @@ phpbb.confirm = function(msg, callback, fadedark) {
|
|||
e.stopPropagation();
|
||||
return true;
|
||||
});
|
||||
div.find('input[type="button"]').one('click', function() {
|
||||
|
||||
var click_handler = function() {
|
||||
var res = this.className === 'button1';
|
||||
var fade = (typeof fadedark !== 'undefined' && !fadedark && res) ? div : dark;
|
||||
fade.fadeOut(phpbb.alert_time, function() {
|
||||
div.hide();
|
||||
});
|
||||
div.find('input[type="button"]').unbind('click');
|
||||
div.find('input[type="button"]').unbind('click', click_handler);
|
||||
callback(res);
|
||||
return false;
|
||||
});
|
||||
};
|
||||
div.find('input[type="button"]').one('click', click_handler);
|
||||
|
||||
dark.one('click', function(e) {
|
||||
div.find('.alert_close').unbind('click');
|
||||
var fade = (typeof fadedark !== 'undefined' && !fadedark && res) ? div : dark;
|
||||
fade.fadeOut(phpbb.alert_time, function() {
|
||||
dark.fadeOut(phpbb.alert_time, function() {
|
||||
div.hide();
|
||||
});
|
||||
callback(false);
|
||||
|
|
Loading…
Add table
Reference in a new issue