Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefix classes needed for JS functionality with 'js-' #743

Open
wants to merge 1 commit into
base: 8.x-2.x
Choose a base branch
from

Conversation

gauravjeet
Copy link

Copy link
Contributor

@mglaman mglaman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add the js- class name along with the existing. Just because people will be theming against the existing CSS classes. @bojanz thoughts?

@@ -238,5 +238,5 @@ function commerce_cart_views_data_alter(array &$data) {
* Prepares variables for the cart block element template.
*/
function template_preprocess_commerce_cart_block(&$variables) {
$variables['attributes']['class'][] = 'cart--cart-block';
$variables['attributes']['class'][] = 'js-cart--cart-block';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we also keep the non js- variant? for theming

@@ -237,7 +237,7 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta
['data' => $this->t('Settings'), 'colspan' => 2],
],
'#attributes' => [
'class' => ['checkout-pane-overview'],
'class' => ['js-checkout-pane-overview'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous comment

@@ -106,7 +106,7 @@ protected function buildRedirectForm(array $form, FormStateInterface $form_state
*/
public static function processRedirectForm(array $element, FormStateInterface $form_state, array &$complete_form) {
$complete_form['#action'] = $element['#action'];
$complete_form['#attributes']['class'][] = 'payment-redirect-form';
$complete_form['#attributes']['class'][] = 'js-payment-redirect-form';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants