
| Current Path : /var/www/html/store/web/modules/contrib/commerce/modules/cart/js/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/store/web/modules/contrib/commerce/modules/cart/js/commerce_cart.form.js |
/**
* @file
* Defines Javascript behaviors for the cart form.
*/
(function ($, Drupal, drupalSettings, once) {
'use strict';
Drupal.behaviors.commerceCartForm = {
attach: function (context) {
// Trigger the "Update" button when Enter is pressed in a quantity field.
$(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();
$(':input#edit-submit', $(this).parents('form')).click();
}
});
}
};
})(jQuery, Drupal, drupalSettings, once);