projects
/
yaffs-website
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added the Search API Synonym module to deal specifically with licence and license...
[yaffs-website]
/
web
/
core
/
modules
/
menu_ui
/
menu_ui.admin.es6.js
diff --git
a/web/core/modules/menu_ui/menu_ui.admin.es6.js
b/web/core/modules/menu_ui/menu_ui.admin.es6.js
index 3144d13dc1b33788ae60aefdf1df786fa55fb794..3c824f54833d85db0cfbe1946c8255fedfd4eda8 100644
(file)
--- a/
web/core/modules/menu_ui/menu_ui.admin.es6.js
+++ b/
web/core/modules/menu_ui/menu_ui.admin.es6.js
@@
-3,7
+3,7
@@
* Menu UI admin behaviors.
*/
* Menu UI admin behaviors.
*/
-(function
($, Drupal) {
+(function($, Drupal) {
/**
*
* @type {Drupal~behavior}
/**
*
* @type {Drupal~behavior}
@@
-25,17
+25,19
@@
/**
* Function to set the options of the menu parent item dropdown.
*/
/**
* Function to set the options of the menu parent item dropdown.
*/
- Drupal.menuUiUpdateParentList = function
() {
+ Drupal.menuUiUpdateParentList = function() {
const $menu = $('#edit-menu');
const values = [];
const $menu = $('#edit-menu');
const values = [];
- $menu.find('input:checked').each(function
() {
+ $menu.find('input:checked').each(function() {
// Get the names of all checked menus.
values.push(Drupal.checkPlain($.trim($(this).val())));
});
$.ajax({
// Get the names of all checked menus.
values.push(Drupal.checkPlain($.trim($(this).val())));
});
$.ajax({
- url: `${location.protocol}//${location.host}${Drupal.url('admin/structure/menu/parents')}`,
+ url: `${window.location.protocol}//${window.location.host}${Drupal.url(
+ 'admin/structure/menu/parents',
+ )}`,
type: 'POST',
data: { 'menus[]': values },
dataType: 'json',
type: 'POST',
data: { 'menus[]': values },
dataType: 'json',
@@
-47,16
+49,25
@@
$select.children().remove();
// Add new options to dropdown. Keep a count of options for testing later.
let totalOptions = 0;
$select.children().remove();
// Add new options to dropdown. Keep a count of options for testing later.
let totalOptions = 0;
- Object.keys(options || {}).forEach(
(machineName)
=> {
+ Object.keys(options || {}).forEach(
machineName
=> {
$select.append(
$select.append(
- $(`<option ${machineName === selected ? ' selected="selected"' : ''}></option>`).val(machineName).text(options[machineName]),
+ $(
+ `<option ${
+ machineName === selected ? ' selected="selected"' : ''
+ }></option>`,
+ )
+ .val(machineName)
+ .text(options[machineName]),
);
totalOptions++;
});
// Hide the parent options if there are no options for it.
);
totalOptions++;
});
// Hide the parent options if there are no options for it.
- $select.closest('div').toggle(totalOptions > 0).attr('hidden', totalOptions === 0);
+ $select
+ .closest('div')
+ .toggle(totalOptions > 0)
+ .attr('hidden', totalOptions === 0);
},
});
};
},
});
};
-}
(jQuery, Drupal)
);
+}
)(jQuery, Drupal
);