mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 04:59:21 +03:00
ko hidden: use html5 hidden attribute
ko visible: rollback to use style.display
This commit is contained in:
parent
52e6b9b0ed
commit
c2a5d0fda5
7 changed files with 21 additions and 15 deletions
|
|
@ -1,6 +1,12 @@
|
|||
ko.bindingHandlers['visible'] = {
|
||||
'update': (element, valueAccessor) =>
|
||||
element.hidden = !ko.utils.unwrapObservable(valueAccessor())
|
||||
'update': (element, valueAccessor) => {
|
||||
var value = ko.utils.unwrapObservable(valueAccessor());
|
||||
var isCurrentlyVisible = !(element.style.display == "none");
|
||||
if (value && !isCurrentlyVisible)
|
||||
element.style.display = "";
|
||||
else if (isCurrentlyVisible && !value)
|
||||
element.style.display = "none";
|
||||
}
|
||||
};
|
||||
|
||||
ko.bindingHandlers['hidden'] = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue