updated core from 8.4 to 8.5 : bug with login_destination
This commit is contained in:
@@ -47,14 +47,12 @@
|
||||
$select.children().remove();
|
||||
// Add new options to dropdown. Keep a count of options for testing later.
|
||||
let totalOptions = 0;
|
||||
for (const machineName in options) {
|
||||
if (options.hasOwnProperty(machineName)) {
|
||||
$select.append(
|
||||
$(`<option ${machineName === selected ? ' selected="selected"' : ''}></option>`).val(machineName).text(options[machineName]),
|
||||
);
|
||||
totalOptions++;
|
||||
}
|
||||
}
|
||||
Object.keys(options || {}).forEach((machineName) => {
|
||||
$select.append(
|
||||
$(`<option ${machineName === selected ? ' selected="selected"' : ''}></option>`).val(machineName).text(options[machineName]),
|
||||
);
|
||||
totalOptions++;
|
||||
});
|
||||
|
||||
// Hide the parent options if there are no options for it.
|
||||
$select.closest('div').toggle(totalOptions > 0).attr('hidden', totalOptions === 0);
|
||||
|
||||
@@ -38,12 +38,10 @@
|
||||
$select.children().remove();
|
||||
|
||||
var totalOptions = 0;
|
||||
for (var machineName in options) {
|
||||
if (options.hasOwnProperty(machineName)) {
|
||||
$select.append($('<option ' + (machineName === selected ? ' selected="selected"' : '') + '></option>').val(machineName).text(options[machineName]));
|
||||
totalOptions++;
|
||||
}
|
||||
}
|
||||
Object.keys(options || {}).forEach(function (machineName) {
|
||||
$select.append($('<option ' + (machineName === selected ? ' selected="selected"' : '') + '></option>').val(machineName).text(options[machineName]));
|
||||
totalOptions++;
|
||||
});
|
||||
|
||||
$select.closest('div').toggle(totalOptions > 0).attr('hidden', totalOptions === 0);
|
||||
}
|
||||
|
||||
@@ -43,41 +43,41 @@
|
||||
// in the form, but play nicely with user permissions and form
|
||||
// alterations.
|
||||
const $checkbox = $this.find('.js-form-item-menu-enabled input');
|
||||
const $link_title = $context.find('.js-form-item-menu-title input');
|
||||
const $linkTitle = $context.find('.js-form-item-menu-title input');
|
||||
const $title = $this.closest('form').find('.js-form-item-title-0-value input');
|
||||
// Bail out if we do not have all required fields.
|
||||
if (!($checkbox.length && $link_title.length && $title.length)) {
|
||||
if (!($checkbox.length && $linkTitle.length && $title.length)) {
|
||||
return;
|
||||
}
|
||||
// If there is a link title already, mark it as overridden. The user
|
||||
// expects that toggling the checkbox twice will take over the node's
|
||||
// title.
|
||||
if ($checkbox.is(':checked') && $link_title.val().length) {
|
||||
$link_title.data('menuLinkAutomaticTitleOverridden', true);
|
||||
if ($checkbox.is(':checked') && $linkTitle.val().length) {
|
||||
$linkTitle.data('menuLinkAutomaticTitleOverridden', true);
|
||||
}
|
||||
// Whenever the value is changed manually, disable this behavior.
|
||||
$link_title.on('keyup', () => {
|
||||
$link_title.data('menuLinkAutomaticTitleOverridden', true);
|
||||
$linkTitle.on('keyup', () => {
|
||||
$linkTitle.data('menuLinkAutomaticTitleOverridden', true);
|
||||
});
|
||||
// Global trigger on checkbox (do not fill-in a value when disabled).
|
||||
$checkbox.on('change', () => {
|
||||
if ($checkbox.is(':checked')) {
|
||||
if (!$link_title.data('menuLinkAutomaticTitleOverridden')) {
|
||||
$link_title.val($title.val());
|
||||
if (!$linkTitle.data('menuLinkAutomaticTitleOverridden')) {
|
||||
$linkTitle.val($title.val());
|
||||
}
|
||||
}
|
||||
else {
|
||||
$link_title.val('');
|
||||
$link_title.removeData('menuLinkAutomaticTitleOverridden');
|
||||
$linkTitle.val('');
|
||||
$linkTitle.removeData('menuLinkAutomaticTitleOverridden');
|
||||
}
|
||||
$checkbox.closest('.vertical-tabs-pane').trigger('summaryUpdated');
|
||||
$checkbox.trigger('formUpdated');
|
||||
});
|
||||
// Take over any title change.
|
||||
$title.on('keyup', () => {
|
||||
if (!$link_title.data('menuLinkAutomaticTitleOverridden') && $checkbox.is(':checked')) {
|
||||
$link_title.val($title.val());
|
||||
$link_title.val($title.val()).trigger('formUpdated');
|
||||
if (!$linkTitle.data('menuLinkAutomaticTitleOverridden') && $checkbox.is(':checked')) {
|
||||
$linkTitle.val($title.val());
|
||||
$linkTitle.val($title.val()).trigger('formUpdated');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -8,8 +8,8 @@ configure: entity.menu.collection
|
||||
dependencies:
|
||||
- menu_link_content
|
||||
|
||||
# Information added by Drupal.org packaging script on 2018-01-03
|
||||
version: '8.4.4'
|
||||
# Information added by Drupal.org packaging script on 2018-03-07
|
||||
version: '8.5.0'
|
||||
core: '8.x'
|
||||
project: 'drupal'
|
||||
datestamp: 1515021228
|
||||
datestamp: 1520457825
|
||||
|
||||
@@ -26,38 +26,38 @@
|
||||
var $this = $(this);
|
||||
|
||||
var $checkbox = $this.find('.js-form-item-menu-enabled input');
|
||||
var $link_title = $context.find('.js-form-item-menu-title input');
|
||||
var $linkTitle = $context.find('.js-form-item-menu-title input');
|
||||
var $title = $this.closest('form').find('.js-form-item-title-0-value input');
|
||||
|
||||
if (!($checkbox.length && $link_title.length && $title.length)) {
|
||||
if (!($checkbox.length && $linkTitle.length && $title.length)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($checkbox.is(':checked') && $link_title.val().length) {
|
||||
$link_title.data('menuLinkAutomaticTitleOverridden', true);
|
||||
if ($checkbox.is(':checked') && $linkTitle.val().length) {
|
||||
$linkTitle.data('menuLinkAutomaticTitleOverridden', true);
|
||||
}
|
||||
|
||||
$link_title.on('keyup', function () {
|
||||
$link_title.data('menuLinkAutomaticTitleOverridden', true);
|
||||
$linkTitle.on('keyup', function () {
|
||||
$linkTitle.data('menuLinkAutomaticTitleOverridden', true);
|
||||
});
|
||||
|
||||
$checkbox.on('change', function () {
|
||||
if ($checkbox.is(':checked')) {
|
||||
if (!$link_title.data('menuLinkAutomaticTitleOverridden')) {
|
||||
$link_title.val($title.val());
|
||||
if (!$linkTitle.data('menuLinkAutomaticTitleOverridden')) {
|
||||
$linkTitle.val($title.val());
|
||||
}
|
||||
} else {
|
||||
$link_title.val('');
|
||||
$link_title.removeData('menuLinkAutomaticTitleOverridden');
|
||||
$linkTitle.val('');
|
||||
$linkTitle.removeData('menuLinkAutomaticTitleOverridden');
|
||||
}
|
||||
$checkbox.closest('.vertical-tabs-pane').trigger('summaryUpdated');
|
||||
$checkbox.trigger('formUpdated');
|
||||
});
|
||||
|
||||
$title.on('keyup', function () {
|
||||
if (!$link_title.data('menuLinkAutomaticTitleOverridden') && $checkbox.is(':checked')) {
|
||||
$link_title.val($title.val());
|
||||
$link_title.val($title.val()).trigger('formUpdated');
|
||||
if (!$linkTitle.data('menuLinkAutomaticTitleOverridden') && $checkbox.is(':checked')) {
|
||||
$linkTitle.val($title.val());
|
||||
$linkTitle.val($title.val()).trigger('formUpdated');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
+1
@@ -4,6 +4,7 @@ label: Menu UI configuration
|
||||
migration_tags:
|
||||
- Drupal 6
|
||||
- Drupal 7
|
||||
- Configuration
|
||||
source:
|
||||
plugin: variable
|
||||
variables:
|
||||
@@ -10,6 +10,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
||||
/**
|
||||
* Defines a confirmation form for deletion of a custom menu.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class MenuDeleteForm extends EntityDeleteForm {
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
*
|
||||
* The menu link plugin defines which class defines the corresponding form.
|
||||
*
|
||||
* @internal
|
||||
*
|
||||
* @see \Drupal\Core\Menu\MenuLinkInterface::getFormClass()
|
||||
*/
|
||||
class MenuLinkEditForm extends FormBase {
|
||||
|
||||
@@ -12,6 +12,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
||||
/**
|
||||
* Defines a confirmation form for resetting a single modified menu link.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class MenuLinkResetForm extends ConfirmFormBase {
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
||||
/**
|
||||
* Base form for menu edit forms.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class MenuForm extends EntityForm {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user