Commit 8ff0af85 authored by Daniel Cothran's avatar Daniel Cothran
Browse files

Issue #3261881 by tatianag, andileco, nikathone: Deprecate jquery.once and use...

Issue #3261881 by tatianag, andileco, nikathone: Deprecate jquery.once and use the new core/once lib
parent b5973e46
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -4,8 +4,9 @@ charts_billboard:
    js/charts_billboard.js: { weight: -1 }
  dependencies:
    - charts/global
    - core/drupal
    - core/jquery
    - core/jquery.once
    - core/once
d3:
  remote: 'https://cdnjs.cloudflare.com/ajax/libs/d3/4.9.1/d3.js'
  version: 4.9.1
+4 −6
Original line number Diff line number Diff line
@@ -2,17 +2,15 @@
 * @file
 * JavaScript integration between Billboard and Drupal.
 */
(function ($) {
(function ($, Drupal, once) {
  'use strict';

  Drupal.behaviors.chartsBillboard = {
    attach: function (context, settings) {
      var contents = new Drupal.Charts.Contents();

      $('.charts-billboard', context).once().each(function () {
        var id = $(this).attr('id');
      once('charts-billboard', '.charts-billboard', context).forEach(function (element) {
        var id = element['attributes']['id']['value'];
        bb.generate(contents.getData(id));
      });
    }
  };
}(jQuery));
}(jQuery, Drupal, once));
+2 −1
Original line number Diff line number Diff line
@@ -4,8 +4,9 @@ charts_c3:
    js/charts_c3.js: { weight: -1 }
  dependencies:
    - charts/global
    - core/drupal
    - core/jquery
    - core/jquery.once
    - core/once
d3:
  remote: 'https://d3js.org/d3.v3.min.js'
  version: 3
+4 −6
Original line number Diff line number Diff line
@@ -2,17 +2,15 @@
 * @file
 * JavaScript integration between C3 and Drupal.
 */
(function ($) {
(function ($, Drupal, once) {
  'use strict';

  Drupal.behaviors.chartsC3 = {
    attach: function (context, settings) {
      var contents = new Drupal.Charts.Contents();

      $('.charts-c3', context).once().each(function () {
        var id = $(this).attr('id');
      once('charts-c3', '.charts-c3', context).forEach(function (element) {
        var id = element['attributes']['id']['value'];
        c3.generate(contents.getData(id));
      });
    }
  };
}(jQuery));
}(jQuery, Drupal, once));
+1 −2
Original line number Diff line number Diff line
@@ -10,9 +10,8 @@ charts_chartjs:
    /libraries/chartjs-adapter-date-fns/dist/chartjs-adapter-date-fns.bundle.js: { }
  dependencies:
    - core/jquery
    - core/jquery.once
    - core/drupal

    - core/once
chartjs:
  version: 1.x
  js:
Loading