mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 05:29:20 +03:00
KnockoutJS to ES2015/ES6
TODO: use the new Proxy for ko.observable
This commit is contained in:
parent
a0f8ac0dad
commit
72ed2b08b2
56 changed files with 941 additions and 1873 deletions
|
|
@ -1,11 +1,11 @@
|
|||
(function () {
|
||||
(() => {
|
||||
var hasDomDataExpandoProperty = '__ko__hasDomDataOptionValue__';
|
||||
|
||||
// Normally, SELECT elements and their OPTIONs can only take value of type 'string' (because the values
|
||||
// are stored on DOM attributes). ko.selectExtensions provides a way for SELECTs/OPTIONs to have values
|
||||
// that are arbitrary objects. This is very convenient when implementing things like cascading dropdowns.
|
||||
ko.selectExtensions = {
|
||||
readValue : function(element) {
|
||||
readValue : element => {
|
||||
switch (ko.utils.tagNameLower(element)) {
|
||||
case 'option':
|
||||
if (element[hasDomDataExpandoProperty] === true)
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
}
|
||||
},
|
||||
|
||||
writeValue: function(element, value, allowUnset) {
|
||||
writeValue: (element, value, allowUnset) => {
|
||||
switch (ko.utils.tagNameLower(element)) {
|
||||
case 'option':
|
||||
if (typeof value === "string") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue