Skip to content
Snippets Groups Projects
Commit 148440a4 authored by renatog's avatar renatog Committed by renatog
Browse files

Issue #3270540 by RenatoG: Move the default case from admin area to JS using Drupal.settings

parent c840f294
Branches
Tags
10 merge requests!62Issue #3272848 by RenatoG: When the error appear the field is hidden and the...,!59Issue #3497768: Click JavaScript to close details causes modals to scroll unnecessarily,!35Issue #3366420: \Drupal calls should be avoided in classes,!34Issue #3366420: \Drupal calls should be avoided in classes,!29Issue #3272632 by RenatoG: Add a logic to block and disable the remove item if...,!28Issue #3272632 by RenatoG: Add a logic to block and disable the remove item if...,!23Issue #3272632 by RenatoG: Add a logic to block and disable the remove item if...,!22Issue #3272632 by RenatoG: Add a logic to block and disable the remove item if...,!20Issue #3272632 by RenatoG: Add a logic to block and disable the remove item if...,!7Issue #3320529 by justcaldwell: block_classes_stored setting only retains classes from most recently saved block
......@@ -9,6 +9,15 @@
Drupal.behaviors.blockClass = {
attach: function (context, settings) {
// Get the default case of Block Class.
var default_case = 'standard';
if (typeof settings.block_class != 'undefined' && settings.block_class.default_case != 'undefined') {
default_case = settings.block_class.default_case;
}
}
};
})(jQuery, Drupal, drupalSettings);
......@@ -361,6 +361,13 @@ class BlockClassHelperService {
$form['#validate'][] = 'block_class_form_block_form_validate';
$form['#attached']['library'][] = 'block_class/block-class';
// Get the default case on settings.
$default_case = $config->get('default_case', 'standard');
// Put the "default case" in the Drupal settings to be used in the JS.
$form['#attached']['drupalSettings']['block_class']['default_case'] = $default_case;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment