mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-11-02 10:28:50 +03:00
Improved Knockout property binding error
This commit is contained in:
parent
4022d39f76
commit
92a6027aa0
7 changed files with 37 additions and 35 deletions
|
|
@ -69,7 +69,7 @@ ko.bindingHandlers['checked'] = {
|
|||
elemValue = undefined;
|
||||
}
|
||||
}
|
||||
ko.expressionRewriting.writeValueToProperty(modelValue, allBindings, 'checked', elemValue, true);
|
||||
ko.expressionRewriting.writeValueToProperty(element, modelValue, allBindings, 'checked', elemValue, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ ko.bindingHandlers['hasfocus'] = {
|
|||
// Discussion at https://github.com/SteveSanderson/knockout/pull/352
|
||||
element[hasfocusUpdatingProperty] = true;
|
||||
isFocused = (element.ownerDocument.activeElement === element);
|
||||
ko.expressionRewriting.writeValueToProperty(valueAccessor(), allBindings, 'hasfocus', isFocused, true);
|
||||
ko.expressionRewriting.writeValueToProperty(element, valueAccessor(), allBindings, 'hasfocus', isFocused, true);
|
||||
|
||||
//cache the latest value, so we can avoid unnecessarily calling focus/blur in the update function
|
||||
element[hasfocusLastValue] = isFocused;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ ko.bindingHandlers['textInput'] = {
|
|||
if (element.checkValidity() && previousElementValue !== elementValue) {
|
||||
// Provide a way for tests to know exactly which event was processed
|
||||
previousElementValue = elementValue;
|
||||
ko.expressionRewriting.writeValueToProperty(valueAccessor(), allBindings, 'textInput', elementValue);
|
||||
ko.expressionRewriting.writeValueToProperty(element, valueAccessor(), allBindings, 'textInput', elementValue);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ ko.bindingHandlers['value'] = {
|
|||
elementValueBeforeEvent = null;
|
||||
var modelValue = valueAccessor();
|
||||
var elementValue = ko.selectExtensions.readValue(element);
|
||||
ko.expressionRewriting.writeValueToProperty(modelValue, allBindings, 'value', elementValue);
|
||||
ko.expressionRewriting.writeValueToProperty(element, modelValue, allBindings, 'value', elementValue);
|
||||
};
|
||||
|
||||
if (requestedEventsToCatch) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue