From 36ccfb06f4928971e4177dd0621246c90490cbe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristjan=20K=C3=A4=C3=A4rma?= Date: Fri, 17 Mar 2023 07:53:04 +0200 Subject: [PATCH 1/2] remove $-prefix that can break legacy code on same site --- src/core/resize.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/resize.js b/src/core/resize.js index bfac545..4e82363 100644 --- a/src/core/resize.js +++ b/src/core/resize.js @@ -31,7 +31,7 @@ export default { }, methods: { - $_change_video_resolution() { + _change_video_resolution() { this.width = this.$_innerWidth(); }, $_innerWidth() { @@ -44,12 +44,12 @@ export default { }, beforeMount() { - this.$_change_video_resolution(); + this._change_video_resolution(); }, mounted() { - window.addEventListener('resize', throttle(this.$_change_video_resolution, 250)); + window.addEventListener('resize', throttle(this._change_video_resolution, 250)); }, beforeUnmount() { - window.removeEventListener('resize', throttle(this.$_change_video_resolution, 250)); + window.removeEventListener('resize', throttle(this._change_video_resolution, 250)); }, }; From 84e5939ba1fe77f169f1458497331b084d76974c Mon Sep 17 00:00:00 2001 From: Philipp Date: Sun, 15 Dec 2024 13:07:14 +0700 Subject: [PATCH 2/2] fix: disable no-underscore-dangle rule for private methods --- src/core/resize.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/resize.js b/src/core/resize.js index 4e82363..49570a2 100644 --- a/src/core/resize.js +++ b/src/core/resize.js @@ -1,5 +1,6 @@ import throttle from '../lib/throttle'; +/* eslint-disable no-underscore-dangle */ export default { data() { return { @@ -53,3 +54,4 @@ export default { window.removeEventListener('resize', throttle(this._change_video_resolution, 250)); }, }; +/* eslint-enable no-underscore-dangle */