From 6c7e77bc5a0c7a8e5aa5960817745e7c5fb74a0b Mon Sep 17 00:00:00 2001 From: tophf Date: Tue, 15 Dec 2020 01:45:59 +0300 Subject: [PATCH] use helpPopup.close() --- edit/linter-dialogs.js | 7 ++++--- edit/sections-editor.js | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/edit/linter-dialogs.js b/edit/linter-dialogs.js index fdc392af..6cfee4e7 100644 --- a/edit/linter-dialogs.js +++ b/edit/linter-dialogs.js @@ -10,6 +10,7 @@ define(require => { } = require('/js/dom'); const t = require('/js/localization'); const {chromeSync} = require('/js/storage-util'); + const editor = require('./editor'); const {DEFAULTS, worker} = require('./linter-manager'); const {getIssues} = require('./linter-report'); const { @@ -166,9 +167,9 @@ define(require => { }; } - function onConfigCancel(event) { - event.preventDefault(); - $('.dismiss').click(); + function onConfigCancel() { + helpPopup.close(); + editor.closestVisible().focus(); } function onConfigClose() { diff --git a/edit/sections-editor.js b/edit/sections-editor.js index 8a5b4b40..8dc48849 100644 --- a/edit/sections-editor.js +++ b/edit/sections-editor.js @@ -390,7 +390,7 @@ define(require => function SectionsEditor() { replace: replaceOldStyle, focusOn: replaceOldStyle ? 0 : false, }); - $('.dismiss').dispatchEvent(new Event('click')); + helpPopup.close(); } } catch (err) { showError(err);