mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Cleanup some mobile modal screen sizes
And simplify the ko command bindinghandler to use CSS :enabled
This commit is contained in:
parent
f673344408
commit
fe45179847
6 changed files with 12 additions and 49 deletions
|
|
@ -323,12 +323,7 @@ export function startScreens(screensClasses) {
|
|||
function decorateKoCommands(thisArg, commands) {
|
||||
Object.entries(commands).forEach(([key, canExecute]) => {
|
||||
let command = thisArg[key],
|
||||
fn = function(...args) {
|
||||
if (fn.enabled() && fn.canExecute()) {
|
||||
command.apply(thisArg, args);
|
||||
}
|
||||
return false;
|
||||
};
|
||||
fn = (...args) => fn.enabled() && fn.canExecute() && command.apply(thisArg, args);
|
||||
|
||||
// fn.__realCanExecute = canExecute;
|
||||
// fn.isCommand = true;
|
||||
|
|
@ -337,7 +332,7 @@ function decorateKoCommands(thisArg, commands) {
|
|||
|
||||
fn.canExecute = (typeof canExecute === 'function')
|
||||
? ko.computed(() => fn.enabled() && canExecute.call(thisArg, thisArg))
|
||||
: ko.computed(() => fn.enabled() && !!canExecute);
|
||||
: ko.computed(() => fn.enabled());
|
||||
|
||||
thisArg[key] = fn;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue