mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-03 06:27:02 +03:00
knockout appendChild => append
and tested closure-compiler 0.2.12 but still broken for es6 mode
This commit is contained in:
parent
7713f459ac
commit
0f56c7d28f
11 changed files with 209 additions and 188 deletions
|
|
@ -1,14 +1,14 @@
|
|||
(function() {
|
||||
|
||||
function addOrRemoveItem(array, value, included) {
|
||||
var existingEntryIndex = ko.utils.arrayIndexOf(ko.utils.peekObservable(array), value);
|
||||
if (existingEntryIndex < 0) {
|
||||
if (included)
|
||||
array.push(value);
|
||||
} else {
|
||||
if (!included)
|
||||
array.splice(existingEntryIndex, 1);
|
||||
}
|
||||
var existingEntryIndex = ko.utils.arrayIndexOf(ko.utils.peekObservable(array), value);
|
||||
if (existingEntryIndex < 0) {
|
||||
if (included)
|
||||
array.push(value);
|
||||
} else {
|
||||
if (!included)
|
||||
array.splice(existingEntryIndex, 1);
|
||||
}
|
||||
}
|
||||
|
||||
ko.bindingHandlers['checked'] = {
|
||||
|
|
|
|||
|
|
@ -3,12 +3,12 @@ var classesWrittenByBindingKey = '__ko__cssValue';
|
|||
// For details on the pattern for changing node classes
|
||||
// see: https://github.com/knockout/knockout/issues/1597
|
||||
function toggleDomNodeCssClass(node, classNames, shouldHaveClass) {
|
||||
if (classNames) {
|
||||
var addOrRemoveFn = shouldHaveClass ? 'add' : 'remove';
|
||||
classNames.split(/\s+/).forEach(function(className) {
|
||||
node.classList[addOrRemoveFn](className);
|
||||
});
|
||||
}
|
||||
if (classNames) {
|
||||
var addOrRemoveFn = shouldHaveClass ? 'add' : 'remove';
|
||||
classNames.split(/\s+/).forEach(function(className) {
|
||||
node.classList[addOrRemoveFn](className);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
ko.bindingHandlers['class'] = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue