From bdee187d7ea0a47cf83bd060fabf2e7f10dfed0d Mon Sep 17 00:00:00 2001 From: Sabina Talipova Date: Fri, 30 Jun 2023 08:51:57 +1200 Subject: [PATCH] MNT ESLint issues --- client/src/js/realme.js | 118 ++++++++++++++++++++-------------------- 1 file changed, 59 insertions(+), 59 deletions(-) diff --git a/client/src/js/realme.js b/client/src/js/realme.js index f48a925..cb37418 100755 --- a/client/src/js/realme.js +++ b/client/src/js/realme.js @@ -9,108 +9,108 @@ */ // eslint-disable-next-line no-use-before-define const RealMe = RealMe || (function (document, window, jQuery) { - /** + /** * Windows Phone with the mango update doesn't realise it has touchevents. * @type {Boolean} */ - const isIE9Mobile = navigator.userAgent.match(/(IEMobile\/9.0)/); - const isIE6 = /\bMSIE 6/.test(navigator.userAgent) && !window.opera; + const isIE9Mobile = navigator.userAgent.match(/(IEMobile\/9.0)/); + const isIE6 = /\bMSIE 6/.test(navigator.userAgent) && !window.opera; - if (isIE6) { - return false; - } + if (isIE6) { + return false; + } - /** + /** * Internal namespace for RealMe * @type {Object} */ - const RM = { + const RM = { - /** + /** * Cache all our DOM elements * @return {void} */ - cacheElements() { - this.$container = jQuery('.realme_widget'); - this.$trigger = jQuery('.whats_realme', this.$container); - this.$modal = jQuery('.realme_popup', this.$container); - }, + cacheElements() { + this.$container = jQuery('.realme_widget'); + this.$trigger = jQuery('.whats_realme', this.$container); + this.$modal = jQuery('.realme_popup', this.$container); + }, - /** + /** * Called when jQuery Document is ready. * Simple feature detection to determine if device is touch or not * @return {void} */ - init() { - /** + init() { + /** * Get all the elements when we init. */ - this.cacheElements(); - if ('ontouchstart' in document || isIE9Mobile !== null) { - this.$container.addClass('touch'); - this.popup_window(); - } else { - this.$container.addClass('no_touch'); - this.bind_no_touch(); - } - }, + this.cacheElements(); + if ('ontouchstart' in document || isIE9Mobile !== null) { + this.$container.addClass('touch'); + this.popup_window(); + } else { + this.$container.addClass('no_touch'); + this.bind_no_touch(); + } + }, - /** + /** * use JS to prevent the href on the from being followed in case user clicks instead of just hovers * @return {void} */ - bind_no_touch() { - this.$trigger.on('click', (e) => { - e.preventDefault(); - }); - }, + bind_no_touch() { + this.$trigger.on('click', (e) => { + e.preventDefault(); + }); + }, - /** + /** * [bind events for touch devices - add class to popup window to show / hide it * @param {jQuery element} $elem * @return {void} */ - show_popup() { - this.$modal.addClass('active'); - }, + show_popup() { + this.$modal.addClass('active'); + }, - /** + /** * @param {jQuery element} $elem * @return {void} */ - hide_popup() { - this.$modal.removeClass('active'); - }, + hide_popup() { + this.$modal.removeClass('active'); + }, - /** + /** * Popups up an information modal * @param {jQuery element} $link * @param {jQuery element} $modal * @return {void} */ - popup_window() { - const me = this; - - this.$trigger.click(function (e) { - if (this.$modal.hasClass('active')) { - me.hide_popup(); - } else { - me.show_popup(); - } - e.stopPropagation(); - }); + popup_window() { + const me = this; - this.$trigger.click(() => false); + this.$trigger.click(function (e) { + if (this.$modal.hasClass('active')) { + me.hide_popup(); + } else { + me.show_popup(); } - }; + e.stopPropagation(); + }); - /** + this.$trigger.click(() => false); + } + }; + + /** * Initialise RealMe widget * @return {[type]} */ - jQuery(document).ready(() => { - RM.init(); - }); + jQuery(document).ready(() => { + RM.init(); + }); - return RM; + return RM; }(document, window, jQuery));