From 91953bfc2b6afddc685feef29b6860189be81559 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 5 Dec 2019 21:43:59 +0100 Subject: [PATCH] Properly test always checkbox in user warning We stop using callback on checkbox to store the value but use directly the value from the widget. issue8847 review272541002 --- src/common.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/common.js b/src/common.js index d64992efc4..8a1d7f4bb8 100644 --- a/src/common.js +++ b/src/common.js @@ -2953,20 +2953,18 @@ Sao.common.UserWarningDialog = Sao.class_(Sao.common.WarningDialog, { class_: 'user-warning-dialog', - always: false, - _set_always: function() { - this.always = jQuery(this).prop('checked'); - }, build_dialog: function(message, title, prm) { var dialog = Sao.common.UserWarningDialog._super.build_dialog.call( this, message, title, prm); - dialog.body.append(jQuery('
') - .append(jQuery('', { - 'type': 'checkbox' - }).change(this._set_always.bind(this))) - .append(jQuery('') - .text(Sao.i18n.gettext('Always ignore this warning.'))) - ); + var always = jQuery('', { + 'type': 'checkbox' + }); + dialog.body.append(jQuery('
', { + 'class': 'checkbox', + }).append(jQuery('