Loading js/block-class.js +10 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,16 @@ $('.hidden-class-field').first().removeClass('hidden-class-field'); }); // On click to remove item, prevent default to stop going to another // page. $(".block-class-remove-item").on( "click", function(event) { // Prevent Default to stop the normal behavior and avoid going to // another page. event.preventDefault(); }); // Get the default case of Block Class. var default_case = 'standard'; Loading src/Service/BlockClassHelperService.php +10 −1 Original line number Diff line number Diff line Loading @@ -400,12 +400,21 @@ class BlockClassHelperService { // Add another item button in the last field. $form['third_party_settings']['block_class']['add_another_item'] = [ '#type' => 'button', '#value' => 'Add another item', '#value' => 'Add another class', ]; // Add the class to identity the "add another item" button. $form['third_party_settings']['block_class']['add_another_item']['#attributes']['class'][] = 'block-class-add-another-item'; // Add remove item button in the last field. $form['third_party_settings']['block_class']['remove_item'] = [ '#type' => 'button', '#value' => 'Remove class', ]; // Add the class to identity the "Remove item" button. $form['third_party_settings']['block_class']['remove_item']['#attributes']['class'][] = 'block-class-remove-item'; } $form['third_party_settings']['block_class']['classes']['#attributes']['class'][] = 'block-class-class'; Loading Loading
js/block-class.js +10 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,16 @@ $('.hidden-class-field').first().removeClass('hidden-class-field'); }); // On click to remove item, prevent default to stop going to another // page. $(".block-class-remove-item").on( "click", function(event) { // Prevent Default to stop the normal behavior and avoid going to // another page. event.preventDefault(); }); // Get the default case of Block Class. var default_case = 'standard'; Loading
src/Service/BlockClassHelperService.php +10 −1 Original line number Diff line number Diff line Loading @@ -400,12 +400,21 @@ class BlockClassHelperService { // Add another item button in the last field. $form['third_party_settings']['block_class']['add_another_item'] = [ '#type' => 'button', '#value' => 'Add another item', '#value' => 'Add another class', ]; // Add the class to identity the "add another item" button. $form['third_party_settings']['block_class']['add_another_item']['#attributes']['class'][] = 'block-class-add-another-item'; // Add remove item button in the last field. $form['third_party_settings']['block_class']['remove_item'] = [ '#type' => 'button', '#value' => 'Remove class', ]; // Add the class to identity the "Remove item" button. $form['third_party_settings']['block_class']['remove_item']['#attributes']['class'][] = 'block-class-remove-item'; } $form['third_party_settings']['block_class']['classes']['#attributes']['class'][] = 'block-class-class'; Loading