Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
Cleanup KnockoutJS a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
the-djmaze committed Oct 30, 2024
1 parent 4cd5774 commit bc6a2b6
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 65 deletions.
11 changes: 3 additions & 8 deletions vendors/knockout/build/output/knockout-latest.debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,7 @@ ko.selectExtensions = {
switch (element.nodeName) {
case 'OPTION':
return (element[hasDomDataExpandoProperty] === true)
? ko.utils.domData.get(element, ko.bindingHandlers.options.optionValueDomDataKey)
? ko.utils.domData.get(element, ko.bindingHandlers['options'].optionValueDomDataKey)
: element.value;
case 'SELECT':
return element.selectedIndex >= 0
Expand All @@ -1280,13 +1280,13 @@ ko.selectExtensions = {
switch (element.nodeName) {
case 'OPTION':
if (typeof value === "string") {
ko.utils.domData.set(element, ko.bindingHandlers.options.optionValueDomDataKey, undefined);
ko.utils.domData.set(element, ko.bindingHandlers['options'].optionValueDomDataKey, undefined);
delete element[hasDomDataExpandoProperty];
element.value = value;
}
else {
// Store arbitrary object using DomData
ko.utils.domData.set(element, ko.bindingHandlers.options.optionValueDomDataKey, value);
ko.utils.domData.set(element, ko.bindingHandlers['options'].optionValueDomDataKey, value);
element[hasDomDataExpandoProperty] = true;

// Special treatment of numbers is just for backward compatibility. KO 1.2.1 wrote numerical values to element.value.
Expand Down Expand Up @@ -2189,16 +2189,11 @@ ko.exportSymbol('bindingHandlers', ko.bindingHandlers);
'init': (element, valueAccessor, ignored1, ignored2, bindingContext) => {
var currentViewModel,
currentLoadingOperationId,
afterRenderSub,
disposeAssociatedComponentViewModel = () => {
var currentViewModelDispose = currentViewModel && currentViewModel['dispose'];
if (typeof currentViewModelDispose === 'function') {
currentViewModelDispose.call(currentViewModel);
}
if (afterRenderSub) {
afterRenderSub['dispose']();
}
afterRenderSub = null;
currentViewModel = null;
// Any in-flight loading operation is no longer relevant, so make sure we ignore its completion
currentLoadingOperationId = null;
Expand Down
Loading

0 comments on commit bc6a2b6

Please sign in to comment.