Skip to content
Snippets Groups Projects
Commit 74282e4a authored by Stephen Mustgrave's avatar Stephen Mustgrave
Browse files

Issue #3454890 by kishan@kk: TypeError: $(...).find(...).once is not a function

parent ded21085
No related branches found
No related tags found
No related merge requests found
Pipeline #437202 passed with warnings
......@@ -5,13 +5,11 @@
* @preserve
* */
(function ($, Drupal) {
(function ($, once, Drupal) {
Drupal.behaviors.plotlyjs = {
attach: function attach(context, settings) {
$.each(settings.plotlyjs, function (key, graph) {
$.each(
$(context).find(`#${graph.unique_id}`).once('generate-plotly'),
function (index, item) {
$(once('generate-plotly','#' + graph.unique_id, context)).each(function () {
if (
typeof graph.mapbox_access_token !== 'undefined' &&
graph.mapbox_access_token !== ''
......@@ -30,4 +28,4 @@
});
},
};
})(jQuery, Drupal);
})(jQuery, once, Drupal);
......@@ -10,6 +10,6 @@ plotly_js.plotly:
js/plotly.builder.js: {}
dependencies:
- core/jquery
- core/jquery.once
- core/once
- core/drupal
- core/drupalSettings
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment