updated core to 8.6.3

This commit is contained in:
2018-11-21 12:49:46 +01:00
parent 8ca34853a3
commit c92c348eee
521 changed files with 12199 additions and 4578 deletions
+1 -1
View File
@@ -28,7 +28,7 @@
* @type {Drupal~behavior}
*
* @prop {Drupal~behaviorAttach} attach
* Attaches the behavior for drupalAnnouce.
* Attaches the behavior for drupalAnnounce.
*/
Drupal.behaviors.drupalAnnounce = {
attach(context) {
+1 -1
View File
@@ -218,7 +218,7 @@
.find('input.form-autocomplete')
.once('autocomplete');
if ($autocomplete.length) {
// Allow options to be overriden per instance.
// Allow options to be overridden per instance.
const blacklist = $autocomplete.attr(
'data-autocomplete-first-character-blacklist',
);
+1 -1
View File
@@ -6,7 +6,7 @@
/**
* Fix problem with details/summary lines missing the drop arrows.
*/
@-moz-document url-prefix() {
@media (min--moz-device-pixel-ratio: 0) {
summary {
display: list-item;
}
+38 -12
View File
@@ -59,6 +59,30 @@
return typeof a === 'undefined' || typeof b === 'undefined';
}
/**
* Bitwise AND with a third undefined state.
*
* @function Drupal.states~ternary
*
* @param {*} a
* Value a.
* @param {*} b
* Value b
*
* @return {bool}
* The result.
*/
function ternary(a, b) {
if (typeof a === 'undefined') {
return b;
}
if (typeof b === 'undefined') {
return a;
}
return a && b;
}
/**
* Attaches the states.
*
@@ -305,18 +329,20 @@
// bogus, we don't want to end up with an infinite loop.
else if ($.isPlainObject(constraints)) {
// This constraint is an object (AND).
result = Object.keys(constraints).every(constraint => {
const check = this.checkConstraints(
constraints[constraint],
selector,
constraint,
);
/**
* The checkConstraints() function's return value can be undefined. If
* this so, consider it to have returned true.
*/
return typeof check === 'undefined' ? true : check;
});
// eslint-disable-next-line no-restricted-syntax
for (const n in constraints) {
if (constraints.hasOwnProperty(n)) {
result = ternary(
result,
this.checkConstraints(constraints[n], selector, n),
);
// False and anything else will evaluate to false, so return when
// any false condition is found.
if (result === false) {
return false;
}
}
}
}
return result;
},
+21 -8
View File
@@ -24,6 +24,17 @@
return typeof a === 'undefined' || typeof b === 'undefined';
}
function ternary(a, b) {
if (typeof a === 'undefined') {
return b;
}
if (typeof b === 'undefined') {
return a;
}
return a && b;
}
Drupal.behaviors.states = {
attach: function attach(context, settings) {
var $states = $(context).find('[data-drupal-states]');
@@ -127,8 +138,6 @@
}
},
verifyConstraints: function verifyConstraints(constraints, selector) {
var _this3 = this;
var result = void 0;
if ($.isArray(constraints)) {
var hasXor = $.inArray('xor', constraints) === -1;
@@ -144,11 +153,15 @@
}
}
} else if ($.isPlainObject(constraints)) {
result = Object.keys(constraints).every(function (constraint) {
var check = _this3.checkConstraints(constraints[constraint], selector, constraint);
for (var n in constraints) {
if (constraints.hasOwnProperty(n)) {
result = ternary(result, this.checkConstraints(constraints[n], selector, n));
return typeof check === 'undefined' ? true : check;
});
if (result === false) {
return false;
}
}
}
}
return result;
},
@@ -197,7 +210,7 @@
states.Trigger.prototype = {
initialize: function initialize() {
var _this4 = this;
var _this3 = this;
var trigger = states.Trigger.states[this.state];
@@ -205,7 +218,7 @@
trigger.call(window, this.element);
} else {
Object.keys(trigger || {}).forEach(function (event) {
_this4.defaultTrigger(event, trigger[event]);
_this3.defaultTrigger(event, trigger[event]);
});
}