Skip to content
Snippets Groups Projects
Commit db77943a authored by Vitaliy Marchuk's avatar Vitaliy Marchuk Committed by Tom Ashe
Browse files

Issue #3385416 by nicxvan, vmarchuk, TomTech, rszrama: Remove the Classy...

Issue #3385416 by nicxvan, vmarchuk, TomTech, rszrama: Remove the Classy dependency for D10 compatibility
parent fbed8bff
No related branches found
Tags 8.x-3.0-alpha5
1 merge request!15Issue #3385416: Remove the Classy dependency for D10 compatibility.
......@@ -73,7 +73,6 @@ hosted-fields:
js/hosted-fields.js: {}
js/commerce_braintree.js: {}
dependencies:
- classy/messages
- core/jquery
- core/drupal
- core/once
......@@ -87,7 +86,6 @@ checkout-review:
js:
js/commerce_braintree.review.js: {}
dependencies:
- classy/messages
- core/drupal.dialog
- core/drupalSettings
- core/drupal
......@@ -102,7 +100,6 @@ paypal:
js/paypal.js: {}
js/commerce_braintree.js: {}
dependencies:
- classy/messages
- core/jquery
- core/drupal
- core/once
......
......@@ -17,3 +17,18 @@ function commerce_braintree_theme() {
],
];
}
/**
* Implements hook_library_info_alter().
*/
function commerce_braintree_library_info_alter(array &$libraries, $module) {
if ($module === 'commerce_braintree') {
// Adds a dependency on the payment_messages library only if it is defined.
if (\Drupal::service('library.discovery')->getLibraryByName('commerce_payment', 'payment_messages')) {
$payment_messages = 'commerce_payment/payment_messages';
$libraries['checkout-review']['dependencies'][] = $payment_messages;
$libraries['hosted-fields']['dependencies'][] = $payment_messages;
$libraries['paypal']['dependencies'][] = $payment_messages;
}
}
}
......@@ -67,7 +67,7 @@
$.extend(Drupal.theme, /** @lends Drupal.theme */{
commerceBraintreeError: function (message) {
return $('<div role="alert">' +
'<div class="messages messages--error">' + message + '</div>' +
'<div class="payment-messages payment-messages--error messages messages--error">' + message + '</div>' +
'</div>'
);
}
......
......@@ -176,7 +176,7 @@
$.extend(Drupal.theme, /** @lends Drupal.theme */{
commerceBraintreeReviewError: function (message) {
return $('<div class="braintree-review-error" role="alert">' +
'<div class="messages messages--error">' + message + '</div>' +
'<div class="payment-messages payment-messages--error messages messages--error">' + message + '</div>' +
'</div>'
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment