New answers tagged

0

The below is my solution for this: (function($, Drupal) { Drupal.behaviors.searchResults = { attach: function() { $('#views-form-resources-block-1 .form-item-ka-types') .insertBefore($('#views-form-myblock-block-1 table')); $('#views-form-resources-block-1 #edit-actions--2') .insertAfter($('#views-form-myblock-block-1 .form-...


0

Since the library was not loaded by the theme in my case I needed to do a form alter and then load the library. You can use something like this: //Load JS $form['#attached']['library'][] = 'core/underscore'; $form['#attached']['library'][] = 'my_module/my_forms.js'; } If you are adding your own library will need to define that in ...


2

Defining the library is only half of the process. Libraries are not loaded on every page by default - you need to tell Drupal when it should include your library. For full details, see the Attaching a library to page(s) section of the Adding stylesheets (CSS) and JavaScript (JS) to a Drupal module documentation on drupal.org. I bet you want to attach the ...


Top 50 recent answers are included