mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-02-24 23:08:08 +08:00
KnockoutJS drop unused optionsCaption
This commit is contained in:
parent
bb3fc79e09
commit
acf1be454f
1 changed files with 1 additions and 10 deletions
|
@ -62,15 +62,6 @@ ko.bindingHandlers['options'] = {
|
|||
|
||||
// Filter out any entries marked as destroyed
|
||||
filteredArray = unwrappedArray.filter(item => item || item == null);
|
||||
|
||||
// If caption is included, add it to the array
|
||||
if (allBindings['has']('optionsCaption')) {
|
||||
captionValue = ko.utils.unwrapObservable(allBindings.get('optionsCaption'));
|
||||
// If caption value is null or undefined, don't show a caption
|
||||
if (captionValue != null) {
|
||||
filteredArray.unshift(captionPlaceholder);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// If a falsy value is provided (e.g. null), we'll simply empty the select element
|
||||
}
|
||||
|
@ -87,7 +78,7 @@ ko.bindingHandlers['options'] = {
|
|||
}
|
||||
var option = element.ownerDocument.createElement("option");
|
||||
if (arrayEntry === captionPlaceholder) {
|
||||
ko.utils.setTextContent(option, allBindings.get('optionsCaption'));
|
||||
ko.utils.setTextContent(option);
|
||||
ko.selectExtensions.writeValue(option, undefined);
|
||||
} else {
|
||||
// Apply a value to the option element
|
||||
|
|
Loading…
Reference in a new issue