Replace deprecated String.substr with String.slice

This commit is contained in:
djmaze 2021-12-08 11:35:41 +01:00
parent 2719f08e26
commit b98762dd68
17 changed files with 54 additions and 54 deletions

View file

@ -6,7 +6,7 @@ ko.bindingHandlers['attr'] = {
// Find the namespace of this attribute, if any.
var prefixLen = attrName.indexOf(':');
var namespace = "lookupNamespaceURI" in element && prefixLen > 0 && element.lookupNamespaceURI(attrName.substr(0, prefixLen));
var namespace = "lookupNamespaceURI" in element && prefixLen > 0 && element.lookupNamespaceURI(attrName.slice(0, prefixLen));
// To cover cases like "attr: { checked:someProp }", we want to remove the attribute entirely
// when someProp is a "no value"-like value (strictly null, false, or undefined)

View file

@ -49,7 +49,7 @@ ko.bindingHandlers['value'] = {
elementValueBeforeEvent = ko.selectExtensions.readValue(element);
setTimeout(valueUpdateHandler, 0);
};
eventName = eventName.substring(5);
eventName = eventName.slice(5);
}
registerEventHandler(eventName, handler);
});