mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Replace ko.utils.stringStartsWith with native String.startsWith
This commit is contained in:
parent
2d4ce14b1c
commit
7d97ae3145
2 changed files with 1 additions and 8 deletions
|
|
@ -35,7 +35,7 @@ ko.bindingHandlers['value'] = {
|
||||||
// This is useful, for example, to catch "keydown" events after the browser has updated the control
|
// This is useful, for example, to catch "keydown" events after the browser has updated the control
|
||||||
// (otherwise, ko.selectExtensions.readValue(this) will receive the control's value *before* the key event)
|
// (otherwise, ko.selectExtensions.readValue(this) will receive the control's value *before* the key event)
|
||||||
var handler = valueUpdateHandler;
|
var handler = valueUpdateHandler;
|
||||||
if (ko.utils.stringStartsWith(eventName, "after")) {
|
if ((eventName||'').startsWith("after")) {
|
||||||
handler = () => {
|
handler = () => {
|
||||||
// The elementValueBeforeEvent variable is non-null *only* during the brief gap between
|
// The elementValueBeforeEvent variable is non-null *only* during the brief gap between
|
||||||
// a keyX event firing and the valueUpdateHandler running, which is scheduled to happen
|
// a keyX event firing and the valueUpdateHandler running, which is scheduled to happen
|
||||||
|
|
|
||||||
7
vendors/knockout/src/utils.js
vendored
7
vendors/knockout/src/utils.js
vendored
|
|
@ -89,13 +89,6 @@ ko.utils = {
|
||||||
string.trim() :
|
string.trim() :
|
||||||
string.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g, ''),
|
string.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g, ''),
|
||||||
|
|
||||||
stringStartsWith: (string, startsWith) => {
|
|
||||||
string = string || "";
|
|
||||||
if (startsWith.length > string.length)
|
|
||||||
return false;
|
|
||||||
return string.substring(0, startsWith.length) === startsWith;
|
|
||||||
},
|
|
||||||
|
|
||||||
domNodeIsContainedBy: (node, containedByNode) =>
|
domNodeIsContainedBy: (node, containedByNode) =>
|
||||||
containedByNode.contains(node.nodeType !== 1 ? node.parentNode : node),
|
containedByNode.contains(node.nodeType !== 1 ? node.parentNode : node),
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue