updated core to 8.6.3
This commit is contained in:
+21
-8
@@ -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]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user