Skip to content
Snippets Groups Projects

fix eslint test

Open Patrick Kenny requested to merge issue/json_field-3450116:eslint into 8.x-1.x
Compare and
4 files
+ 55
44
Compare changes
  • Side-by-side
  • Inline
Files
4
+ 13
10
@@ -4,15 +4,17 @@
*/
(function ($, Drupal, drupalSettings, once) {
'use strict';
var options = $.extend(drupalSettings.json_field,
/**
* Default settings for this item.
*/
const options = $.extend(
drupalSettings.json_field,
// Merge strings on top of drupalSettings so that they are not mutable.
{
strings: {
quickEdit: Drupal.t('Quick edit')
}
}
quickEdit: Drupal.t('Quick edit'),
},
},
);
/**
@@ -21,12 +23,13 @@
* @type {Drupal~behavior}
*/
Drupal.behaviors.json_field = {
attach: function (context) {
attach(context) {
// Initialize the Quick Edit app once per page load.
$(once('json-field-init', 'pre.json-field', context)).each(function () {
$(this).parent().JSONView($(this).parent().find('pre code').text());
$(this)
.parent()
.JSONView($(this).parent().find('pre code').textContent);
});
}
},
};
})(jQuery, Drupal, drupalSettings, once);
Loading