Further Drupal 8.6.4 changes. Some core files were not committed before a commit...
[yaffs-website] / web / core / modules / system / tests / modules / ajax_test / js / insert-ajax.js
1 /**
2 * DO NOT EDIT THIS FILE.
3 * See the following change record for more information,
4 * https://www.drupal.org/node/2815083
5 * @preserve
6 **/
7
8 (function ($, window, Drupal) {
9   Drupal.behaviors.insertTest = {
10     attach: function attach(context) {
11       $('.ajax-insert').once('ajax-insert').on('click', function (event) {
12         event.preventDefault();
13         var ajaxSettings = {
14           url: event.currentTarget.getAttribute('href'),
15           wrapper: 'ajax-target',
16           base: false,
17           element: false,
18           method: event.currentTarget.getAttribute('data-method'),
19           effect: event.currentTarget.getAttribute('data-effect')
20         };
21         var myAjaxObject = Drupal.ajax(ajaxSettings);
22         myAjaxObject.execute();
23       });
24
25       $('.ajax-insert-inline').once('ajax-insert').on('click', function (event) {
26         event.preventDefault();
27         var ajaxSettings = {
28           url: event.currentTarget.getAttribute('href'),
29           wrapper: 'ajax-target-inline',
30           base: false,
31           element: false,
32           method: event.currentTarget.getAttribute('data-method'),
33           effect: event.currentTarget.getAttribute('data-effect')
34         };
35         var myAjaxObject = Drupal.ajax(ajaxSettings);
36         myAjaxObject.execute();
37       });
38
39       $(context).addClass('processed');
40     }
41   };
42 })(jQuery, window, Drupal);