mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
decorateKoCommands() each command must have function
And due to that, a bug is found and solved in MessageView
This commit is contained in:
parent
a67fb22bee
commit
f50f2c5ea0
5 changed files with 40 additions and 49 deletions
6
dev/External/ko.js
vendored
6
dev/External/ko.js
vendored
|
|
@ -99,7 +99,7 @@ Object.assign(ko.bindingHandlers, {
|
|||
init: (element, fValueAccessor, fAllBindings, viewModel, bindingContext) => {
|
||||
const command = fValueAccessor();
|
||||
|
||||
if (!command || !command.enabled || !command.canExecute) {
|
||||
if (!command || !command.canExecute) {
|
||||
throw new Error('Value should be a command');
|
||||
}
|
||||
|
||||
|
|
@ -115,9 +115,7 @@ Object.assign(ko.bindingHandlers, {
|
|||
const cl = element.classList,
|
||||
command = fValueAccessor();
|
||||
|
||||
let disabled = !command.enabled();
|
||||
|
||||
disabled = disabled || !command.canExecute();
|
||||
let disabled = !command.canExecute();
|
||||
cl.toggle('disabled', disabled);
|
||||
|
||||
if (element.matches('INPUT,TEXTAREA,BUTTON')) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue