Commit 3cb7b8f6 authored by renatog's avatar renatog Committed by renatog
Browse files

Issue #3276092 by RenatoG: Block class helper to show items used being...

Issue #3276092 by RenatoG: Block class helper to show items used being duplicated when the visualization is on Modal
parent 11b092b6
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
.show-items-used {
  display: inline;
}

.hidden-class-field {
  display: none;
}
+8 −0
Original line number Diff line number Diff line
@@ -9,6 +9,14 @@
  Drupal.behaviors.blockClass = {
    attach: function (context, settings) {

      // Verify if the block class was render in Drupal Modal.
      var isDrupalModal = $('.show-items-used').closest('#drupal-modal');

      // If was loaded in Modal don't show a duplicated Modal.
      if (isDrupalModal.length) {
        $('.show-items-used').css( "display", "none" );
      }

      // Verify if there validated items and should be displayed.
      verifyValidatedItems();

+3 −3
Original line number Diff line number Diff line
@@ -526,7 +526,7 @@ class BlockClassHelperService {
      $help_text = $this->t('Customize the styling of this block by adding CSS classes.');

      // Put the Modal with all items used.
      $help_text .= ' ' . $this->t('<a href="@url_used_items_list@" class="use-ajax" data-dialog-options="{&quot;width&quot;:800}" data-dialog-type="modal">Click here</a> to see all the classes used.', [
      $help_text .= ' <div class="show-items-used">' . $this->t('<a href="@url_used_items_list@" class="use-ajax" data-dialog-options="{&quot;width&quot;:800}" data-dialog-type="modal">Click here</a> to see all the classes used.</div>', [
        '@url_used_items_list@' => $url_used_items_list,
      ]);

@@ -720,10 +720,10 @@ class BlockClassHelperService {
          $url_used_attribute_list = Url::fromRoute('block_class.attribute_list')->toString();

          // Create the help text for the multiple attribute fields.
          $help_text = $this->t('Customize the this block by adding attributes. E.g. "data-block-type"="admin"') . ' - ';
          $help_text = $this->t('Customize the this block by adding attributes. E.g. "data-block-type"="admin"');

          // Update the help text with the Modal to show this for the user.
          $help_text .= ' ' . $this->t('<a href="@url_used_attribute_list@" class="use-ajax" data-dialog-options="{&quot;width&quot;:800}" data-dialog-type="modal">Click here</a> to see all the attributes used.', [
          $help_text .= ' - <div class="show-items-used">' . $this->t('<a href="@url_used_attribute_list@" class="use-ajax" data-dialog-options="{&quot;width&quot;:800}" data-dialog-type="modal">Click here</a> to see all the attributes used.', [
            '@url_used_attribute_list@' => $url_used_attribute_list,
          ]);