mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-27 19:19:21 +03:00
KnockoutJS:
* remove deprecated allBindings as Accessor https://github.com/knockout/knockout/pull/2133 * remove unused event '*Bubble' https://knockoutjs.com/documentation/event-binding.html#note-4-preventing-the-event-from-bubbling * remove unused 'completeOn' https://knockoutjs.com/documentation/binding-lifecycle-events.html#indicating-that-a-control-flow-binding-completes-asynchronously
This commit is contained in:
parent
4cb88b408c
commit
3a32a09f2a
8 changed files with 96 additions and 116 deletions
9
dev/External/User/ko.js
vendored
9
dev/External/User/ko.js
vendored
|
|
@ -64,13 +64,12 @@ ko.bindingHandlers.moment = {
|
|||
};
|
||||
|
||||
ko.bindingHandlers.emailsTags = {
|
||||
init: (element, fValueAccessor, fAllBindingsAccessor) => {
|
||||
const fValue = fValueAccessor(),
|
||||
fAllBindings = fAllBindingsAccessor();
|
||||
init: (element, fValueAccessor, fAllBindings) => {
|
||||
const fValue = fValueAccessor();
|
||||
|
||||
element.addresses = new EmailAddressesComponent(element, {
|
||||
focusCallback: value => fValue.focused && fValue.focused(!!value),
|
||||
autoCompleteSource: fAllBindings.autoCompleteSource || null,
|
||||
autoCompleteSource: fAllBindings.get('autoCompleteSource'),
|
||||
onChange: value => fValue(value)
|
||||
});
|
||||
|
||||
|
|
@ -220,7 +219,7 @@ ko.bindingHandlers.initDom = {
|
|||
};
|
||||
|
||||
ko.bindingHandlers.onEsc = {
|
||||
init: (element, fValueAccessor, fAllBindingsAccessor, viewModel) => {
|
||||
init: (element, fValueAccessor, fAllBindings, viewModel) => {
|
||||
let fn = event => {
|
||||
if ('Escape' == event.key) {
|
||||
element.dispatchEvent(new Event('change'));
|
||||
|
|
|
|||
8
dev/External/ko.js
vendored
8
dev/External/ko.js
vendored
|
|
@ -21,7 +21,7 @@ ko.bindingHandlers.tooltipErrorTip = {
|
|||
};
|
||||
|
||||
ko.bindingHandlers.onEnter = {
|
||||
init: (element, fValueAccessor, fAllBindingsAccessor, viewModel) => {
|
||||
init: (element, fValueAccessor, fAllBindings, viewModel) => {
|
||||
let fn = event => {
|
||||
if ('Enter' == event.key) {
|
||||
element.dispatchEvent(new Event('change'));
|
||||
|
|
@ -34,7 +34,7 @@ ko.bindingHandlers.onEnter = {
|
|||
};
|
||||
|
||||
ko.bindingHandlers.onSpace = {
|
||||
init: (element, fValueAccessor, fAllBindingsAccessor, viewModel) => {
|
||||
init: (element, fValueAccessor, fAllBindings, viewModel) => {
|
||||
let fn = event => {
|
||||
if (' ' == event.key) {
|
||||
fValueAccessor().call(viewModel, event);
|
||||
|
|
@ -73,7 +73,7 @@ ko.bindingHandlers.title = {
|
|||
};
|
||||
|
||||
ko.bindingHandlers.command = {
|
||||
init: (element, fValueAccessor, fAllBindingsAccessor, viewModel, bindingContext) => {
|
||||
init: (element, fValueAccessor, fAllBindings, viewModel, bindingContext) => {
|
||||
const command = fValueAccessor();
|
||||
|
||||
if (!command || !command.enabled || !command.canExecute) {
|
||||
|
|
@ -83,7 +83,7 @@ ko.bindingHandlers.command = {
|
|||
ko.bindingHandlers['FORM'==element.nodeName ? 'submit' : 'click'].init(
|
||||
element,
|
||||
fValueAccessor,
|
||||
fAllBindingsAccessor,
|
||||
fAllBindings,
|
||||
viewModel,
|
||||
bindingContext
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue