Skip to content
Snippets Groups Projects
Commit f8abc7db authored by Jonathan Sacksick's avatar Jonathan Sacksick
Browse files

Issue #3272697 by kimberlly_amaral, jsacksick: Replace jquery/once by core/once.

parent 6e6d9e82
No related branches found
No related tags found
7 merge requests!418Issue #3511232 by ccjjmartin: Fix add to cart dropdown when only one non-default variation type is provided,!379Issue #3491248 Validation is breaking the amount number format decimal point,!375Issue #3413020 by czigor: Using a translatable string as a category for field...,!357Issue #2914933: Add service tags to order-related interfaces,!344Resolve #3107602 "Product attributes do not update visually when switching variations",!343Resolve #3107602 "Product attributes do not update visually when switching variations",!342Issue #3476581 by josephr5000: add OrderItemLabelEvent
......@@ -15,7 +15,7 @@ cart_block:
js/commerce_cart.js: {}
dependencies:
- core/jquery
- core/jquery.once
- core/once
- core/drupal
cart_form:
......@@ -24,5 +24,5 @@ cart_form:
js/commerce_cart.form.js: {}
dependencies:
- core/jquery
- core/jquery.once
- core/once
- core/drupal
......@@ -3,15 +3,14 @@
* Defines Javascript behaviors for the cart form.
*/
(function ($, Drupal, drupalSettings) {
(function ($, Drupal, drupalSettings, once) {
'use strict';
Drupal.behaviors.commerceCartForm = {
attach: function (context) {
// Trigger the "Update" button when Enter is pressed in a quantity field.
$('.quantity-edit-input', context)
.once('commerce-cart-edit-quantity')
.keydown(function (event) {
$(once('commerce-cart-edit-quantity', '.quantity-edit-input', context))
.keydown(function (event) {
if (event.keyCode === 13) {
// Prevent the browser default ("Remove") from being triggered.
event.preventDefault();
......@@ -20,4 +19,4 @@
});
}
};
})(jQuery, Drupal, drupalSettings);
})(jQuery, Drupal, drupalSettings, once);
......@@ -8,7 +8,7 @@ admin:
dependencies:
- core/jquery
- core/drupal
- core/jquery.once
- core/once
login_pane:
version: VERSION
......
......@@ -3,15 +3,14 @@
* Defines Javascript behaviors for the coupon redemption form.
*/
(function ($, Drupal, drupalSettings) {
(function ($, Drupal, drupalSettings, once) {
'use strict';
Drupal.behaviors.commercePromotionCouponRedemptionForm = {
attach: function (context) {
// Trigger the "Apply" button when Enter is pressed in a code field.
$('input[name$="[code]"]', context)
.once('coupon-redemption-code')
.keydown(function (event) {
$(once('coupon-redemption-code', 'input[name$="[code]"]', context))
.keydown(function (event) {
if (event.keyCode === 13) {
// Prevent the browser default from being triggered.
// That is usually the "Next" checkout button.
......@@ -21,4 +20,4 @@
});
}
};
})(jQuery, Drupal, drupalSettings);
})(jQuery, Drupal, drupalSettings, once);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment