Cleanup Squire and Knockout with help of Chromium Code Coverage

Bugfix: Squire inlineNodeNames the 'I' tag was missing
Improved: Squire style editing
This commit is contained in:
djmaze 2021-02-23 22:50:48 +01:00
parent 0158a5fe1e
commit fac36e828b
9 changed files with 2820 additions and 3034 deletions

View file

@ -1,4 +1,4 @@
var arrayChangeEventName = 'arrayChange';
const arrayChangeEventName = 'arrayChange';
ko.extenders['trackArrayChanges'] = (target, options) => {
// Use the provided options--each call to trackArrayChanges overwrites the previously set options
target.compareArrayOptions = {};

View file

@ -32,22 +32,6 @@ ko.observableArray['fn'] = {
this.valueHasMutated();
}
return removedValues;
},
'removeAll': function (arrayOfValues) {
// If you passed zero args, we remove everything
if (arrayOfValues === undefined) {
var underlyingArray = this.peek();
var allValues = underlyingArray.slice(0);
this.valueWillMutate();
underlyingArray.splice(0, underlyingArray.length);
this.valueHasMutated();
return allValues;
}
// If you passed an arg, we interpret it as an array of entries to remove
if (!arrayOfValues)
return [];
return this['remove'](value => arrayOfValues.includes(value));
}
};