mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 12:09:20 +03:00
Focused state for custom checkbox (Closes #604)
This commit is contained in:
parent
48b91fb957
commit
a11dcbed4b
25 changed files with 209 additions and 65 deletions
27
dev/External/ko.js
vendored
27
dev/External/ko.js
vendored
|
|
@ -317,6 +317,18 @@
|
|||
}
|
||||
};
|
||||
|
||||
ko.bindingHandlers.keypress = {
|
||||
'init': function (oElement, fValueAccessor, fAllBindingsAccessor, oViewModel) {
|
||||
$(oElement).on('keypress.koKeyPress', function (oEvent) {
|
||||
fValueAccessor().call(oViewModel, oEvent);
|
||||
});
|
||||
|
||||
ko.utils.domNodeDisposal.addDisposeCallback(oElement, function () {
|
||||
$(oElement).off('keypress.koKeyPress');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
ko.bindingHandlers.onEnter = {
|
||||
'init': function (oElement, fValueAccessor, fAllBindingsAccessor, oViewModel) {
|
||||
$(oElement).on('keypress.koOnEnter', function (oEvent) {
|
||||
|
|
@ -333,6 +345,21 @@
|
|||
}
|
||||
};
|
||||
|
||||
ko.bindingHandlers.onTab = {
|
||||
'init': function (oElement, fValueAccessor, fAllBindingsAccessor, oViewModel) {
|
||||
$(oElement).on('keydown.koOnTab', function (oEvent) {
|
||||
if (oEvent && 9 === window.parseInt(oEvent.keyCode, 10))
|
||||
{
|
||||
return fValueAccessor().call(oViewModel, !!oEvent.shiftKey);
|
||||
}
|
||||
});
|
||||
|
||||
ko.utils.domNodeDisposal.addDisposeCallback(oElement, function () {
|
||||
$(oElement).off('keydown.koOnTab');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
ko.bindingHandlers.onEsc = {
|
||||
'init': function (oElement, fValueAccessor, fAllBindingsAccessor, oViewModel) {
|
||||
$(oElement).on('keypress.koOnEsc', function (oEvent) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue