Skip to content
Snippets Groups Projects

Issue #3492855 by ivnish: Fix eslint warnings

2 files
+ 7
16
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 6
15
(function ($) {
(function ($, Drupal) {
"use strict";
// Adds the JS that binds the textarea with the farbtastic element.
// Adds the JS that binds the textarea with the farbtastic element.
// Find each colorpicker placeholder:
// Find each colorpicker placeholder:
// initialize it,
// initialize it,
// then find the nearby textfield that is of type colorentry
// then find the nearby textfield that is of type colorentry
// and attach the colorpicker behavior to it.
// and attach the colorpicker behavior to it.
// This is so we can support more that one per page if necessary.
// This is so we can support more that one per page if necessary.
Drupal.behaviors.colorpicker = {
Drupal.behaviors.colorpicker = {
attach() {
attach: function (context) {
$('.colorpicker').each(function () {
$('.colorpicker').each(function () {
var $this = $(this);
const linkedTarget = $('.colorentry', $(this).closest('.colorform'));
var linked_target = $('.colorentry', $this.closest('.colorform'));
$.farbtastic($(this), linkedTarget);
$.farbtastic($this, linked_target);
});
});
}
},
};
};
})(jQuery, Drupal);
})(jQuery);
Loading