Skip to content
Code-Schnipsel Gruppen Projekte
Commit 0619681d erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

refactor: use const instead of var in CouponCodeInput.js

Modified 'var' declarations to 'const' in CouponCodeInput.js file for better ES6 compliance. This
refactoring helps increase code readability and ensures variables are block-scoped, reducing the
risk of accidental variable reassignment or mutation.
Übergeordneter 782f0cd0
No related branches found
No related tags found
2 Merge Requests!19Update 'next-3.x' with latest changes from 'main',!18fix(phpstan): code improvements and resolve warnings
......@@ -23,7 +23,7 @@ define('package/quiqqer/coupons/bin/frontend/controls/CouponCodeInput', [
], function(QUI, QUIControl, QUILoader, Sessions, CouponCodes, QUIAjax, QUILocale, Mustache, template) {
'use strict';
var lg = 'quiqqer/coupons';
const lg = 'quiqqer/coupons';
return new Class({
......@@ -50,8 +50,8 @@ define('package/quiqqer/coupons/bin/frontend/controls/CouponCodeInput', [
* Event: onInject
*/
$onInject: function() {
var self = this;
var lgPrefix = 'controls.frontend.CouponCodeInput.template.';
const self = this;
const lgPrefix = 'controls.frontend.CouponCodeInput.template.';
this.$Elm.addClass('quiqqer-coupons-field');
......@@ -81,7 +81,7 @@ define('package/quiqqer/coupons/bin/frontend/controls/CouponCodeInput', [
});
if (this.isInOrder()) {
var OrderProcess = this.getOrderProcess();
const OrderProcess = this.getOrderProcess();
new Promise(function(resolve) {
if (!OrderProcess.isLoaded()) {
......@@ -118,8 +118,8 @@ define('package/quiqqer/coupons/bin/frontend/controls/CouponCodeInput', [
return;
}
var self = this;
var code = this.$Input.value.trim();
const self = this;
const code = this.$Input.value.trim();
if (code === '') {
this.$Input.focus();
......@@ -192,7 +192,7 @@ define('package/quiqqer/coupons/bin/frontend/controls/CouponCodeInput', [
return;
}
var OrderProcess = this.getOrderProcess();
const OrderProcess = this.getOrderProcess();
OrderProcess.Loader.show();
......@@ -239,7 +239,7 @@ define('package/quiqqer/coupons/bin/frontend/controls/CouponCodeInput', [
* @return {boolean}
*/
isInOrder: function() {
var OrderProcessNode = this.getElm().getParent(
const OrderProcessNode = this.getElm().getParent(
'[data-qui="package/quiqqer/order/bin/frontend/controls/OrderProcess"]'
);
......@@ -252,7 +252,7 @@ define('package/quiqqer/coupons/bin/frontend/controls/CouponCodeInput', [
* @return {Object}
*/
getOrderProcess: function() {
var OrderProcessNode = this.getElm().getParent(
const OrderProcessNode = this.getElm().getParent(
'[data-qui="package/quiqqer/order/bin/frontend/controls/OrderProcess"]'
);
......@@ -269,10 +269,10 @@ define('package/quiqqer/coupons/bin/frontend/controls/CouponCodeInput', [
return Promise.resolve();
}
var self = this;
const self = this;
return new Promise(function(resolve) {
var OrderProcess = self.getOrderProcess();
const OrderProcess = self.getOrderProcess();
OrderProcess.Loader.show();
OrderProcess.getOrder().then(function(orderHash) {
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren