Commit a70645bc authored by Artem Dmitriiev's avatar Artem Dmitriiev
Browse files

Issue #3262004: Drupal 10 readiness: Remove use of jquery.once

parent fe443565
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
 * Contains javascript functionality for the draggable blocks module.
 */

(function ($, window, Drupal) {
(function ($, window, Drupal, once) {

  'use strict';

@@ -28,7 +28,8 @@

  Drupal.behaviors.draggable_dashboard = {
    attach: function (context, settings) {
      $('.draggable-dashboard', context).once('dashboard-processed').each(function () {
      const elements = once('dashboard-processed', '.draggable-dashboard', context)
      elements.forEach(function () {
        var $dashboards = $('.draggable-dashboard', context);
        var blocks = {};
        // If we already saved an order in the local storage, get the value
@@ -64,4 +65,4 @@
    }
  };

})(jQuery, window, Drupal);
})(jQuery, window, Drupal, once);
+4 −3
Original line number Diff line number Diff line
@@ -3,11 +3,12 @@
 * Contains javascript functionality for the draggable dashboard module.
 */

(function ($, window, Drupal) {
(function ($, window, Drupal, once) {
  'use strict';
  Drupal.behaviors.draggableDashboardActions = {
    attach: function attach(context, settings) {
      $('.draggable-dashboard', context).once('draggable-processed').each(function () {
      const elements = once('draggable-processed', '.draggable-dashboard', context);
      elements.forEach(function () {
        var blocksMin = [];
        // If we already saved an order in the local storage,
        // get the value and collapse those blocks
@@ -62,4 +63,4 @@
    }
  };

})(jQuery, window, Drupal);
})(jQuery, window, Drupal, once);
+3 −3
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@
 * Contains javascript functionality for the draggable dashboard module.
 */

(function ($, window, Drupal) {
(function ($, window, Drupal, once) {
  'use strict';

  Drupal.behaviors.draggableDashboard = {
@@ -95,7 +95,7 @@
        updateBlockWeights(table, regionName);
      };

      $(context).find('select.block-region-select').once('block-region-select').on('change', function (event) {
      $(once('block-region-select', 'select.block-region-select', context)).on('change', function (event) {
        var row = $(this).closest('tr');
        var select = $(this);

@@ -124,4 +124,4 @@
    }
  };

})(jQuery, window, Drupal);
})(jQuery, window, Drupal, once);
+1 −1
Original line number Diff line number Diff line
@@ -2,6 +2,6 @@ name: Draggable Dashboard
type: module
description: 'Individual and configurable dashboard, so user can see own favourite functions immediately'
package: Content
core_version_requirement: ^8.8 || ^9 || ^10
core_version_requirement: ^9.2 || ^10
dependencies:
  - drupal:block
+1 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ main:
      assets/css/main.css: {}
  dependencies:
    - core/jquery
    - core/once
    - core/drupal

draggable: