Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / taxonomy / taxonomy.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 ($, Drupal) {
9   Drupal.behaviors.termDrag = {
10     attach: function attach(context, settings) {
11       var backStep = settings.taxonomy.backStep;
12       var forwardStep = settings.taxonomy.forwardStep;
13
14       var tableDrag = Drupal.tableDrag.taxonomy;
15       var $table = $('#taxonomy');
16       var rows = $table.find('tr').length;
17
18       tableDrag.row.prototype.onSwap = function (swappedRow) {
19         $table.find('tr.taxonomy-term-preview').removeClass('taxonomy-term-preview');
20         $table.find('tr.taxonomy-term-divider-top').removeClass('taxonomy-term-divider-top');
21         $table.find('tr.taxonomy-term-divider-bottom').removeClass('taxonomy-term-divider-bottom');
22
23         var tableBody = $table[0].tBodies[0];
24         if (backStep) {
25           for (var n = 0; n < backStep; n++) {
26             $(tableBody.rows[n]).addClass('taxonomy-term-preview');
27           }
28           $(tableBody.rows[backStep - 1]).addClass('taxonomy-term-divider-top');
29           $(tableBody.rows[backStep]).addClass('taxonomy-term-divider-bottom');
30         }
31
32         if (forwardStep) {
33           for (var k = rows - forwardStep - 1; k < rows - 1; k++) {
34             $(tableBody.rows[k]).addClass('taxonomy-term-preview');
35           }
36           $(tableBody.rows[rows - forwardStep - 2]).addClass('taxonomy-term-divider-top');
37           $(tableBody.rows[rows - forwardStep - 1]).addClass('taxonomy-term-divider-bottom');
38         }
39       };
40     }
41   };
42 })(jQuery, Drupal);