Commit 78988069 authored by Jeroen Tubex's avatar Jeroen Tubex Committed by Stefan Borchert
Browse files

Issue #3267426: Fix compatibility with Paragraphs 1.13

parent 42888b39
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -248,7 +248,8 @@
    var $element = $(element);

    // Get the delta element before moving $element to dialog element.
    var $modalDelta = $element.parent().find('.paragraph-type-add-modal-delta');
    var $modalDelta = $element.parent().find('.paragraph-type-add-modal-delta, .paragraph-type-add-delta.modal');


    // Deep clone with all attached events. We need to work on cloned element
    // and not directly on origin because Drupal dialog.ajax.js
@@ -282,7 +283,7 @@
   * width.
   */
  Drupal.behaviors.paragraphsModalAdd.attach = function (context) {
    $('.paragraph-type-add-modal-button', context).once('add-click-handler').on('click', function (event) {
    $('.paragraph-type-add-modal-button, .paragraph-type-add-delta.modal', context).once('add-click-handler').on('click', function (event) {
      var $button = $(this);
      Drupal.paragraphsAddModal.openDialog($button.parent().siblings('.paragraphs-ee-dialog-wrapper'), $button.val());

+2 −0
Original line number Diff line number Diff line
@@ -279,6 +279,8 @@ function template_preprocess_paragraphs_add_dialog__categorized(&$variables) {
  $variables['add_mode'] = isset($variables['element']['#add_mode']) ? $variables['element']['#add_mode'] : 'modal';
  if (isset($variables['element']['add_modal_form_area'])) {
    $variables['add'] = $variables['element']['add_modal_form_area'];
    $variables['add']['#attributes']['class'][] = 'paragraph-type-add-delta';
    $variables['add']['#attributes']['class'][] = $variables['add_mode'];
  }
  /** @var \Drupal\paragraphs_ee\ParagraphsCategoryInterface[] $categories */
  $paragraphs_categories = \Drupal::entityTypeManager()->getStorage('paragraphs_category')