From 530a10376ec7cd4f14222fa964c630b54b5eeb9d Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Mon, 2 Nov 2020 13:33:34 +0100 Subject: [PATCH] Document deprecation of `WCF_CLICK_EVENT` (#100) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * Document deprecation of `WCF_CLICK_EVENT` * Use arrow function in WCF_CLICK_EVENT documentation Co-authored-by: Tim Düsterhus Co-authored-by: Tim Düsterhus --- _data/sidebars/sidebar.yml | 2 ++ .../wsc-53/migration_wsc-53_javascript.md | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 pages/migration/wsc-53/migration_wsc-53_javascript.md diff --git a/_data/sidebars/sidebar.yml b/_data/sidebars/sidebar.yml index f4822d63..d4a3548d 100644 --- a/_data/sidebars/sidebar.yml +++ b/_data/sidebars/sidebar.yml @@ -122,6 +122,8 @@ entries: - title: Migrating from WSC 5.3 subfolderitems: + - title: JavaScript + url: /migration_wsc-53_javascript.html - title: Templates url: /migration_wsc-53_templates.html - title: Third Party Libraries diff --git a/pages/migration/wsc-53/migration_wsc-53_javascript.md b/pages/migration/wsc-53/migration_wsc-53_javascript.md new file mode 100644 index 00000000..54a4df68 --- /dev/null +++ b/pages/migration/wsc-53/migration_wsc-53_javascript.md @@ -0,0 +1,19 @@ +--- +title: Migrating from WSC 5.3 - JavaScript +sidebar: sidebar +permalink: migration_wsc-53_javascript.html +folder: migration/wsc-53 +--- + +## `WCF_CLICK_EVENT` + +For event listeners on click events, `WCF_CLICK_EVENT` is deprecated and should no longer be used. +Instead, use `click` directly: + +```javascript +// before +element.addEventListener(WCF_CLICK_EVENT, this._click.bind(this)); + +// after +element.addEventListener('click', (ev) => this._click(ev)); +``` -- 2.20.1