Re: [commits] Horde branch master updated. b2212fa6f30df255024a450c8b98491d1e03049d
Jan Schneider <[email protected]>
| Newsgroups | gmane.comp.horde.devel |
|---|---|
| Message-ID | <[email protected]> |
> commit f708a22e6ba28f52644df950adf1961ad96050ae > Author: Michael M Slusarz <[email protected]> > Date: Tue Apr 15 12:07:45 2014 -0600 > > Correct fix > > Annoying, since this is not a checkbox, so we need to do extra work to > make sure we are doing a 0 <-> 1 conversion (since it is stored as a > string, not an integer, so it is a pain to flip the value since "0" is > not empty-ish in javascript). > > Making the value -1 is not correct, since this is expected to be 0 or 1. > > imp/js/compose-dimp.js | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > http://github.com/horde/horde/commit/f708a22e6ba28f52644df950adf1961ad96050ae My solution worked fine with 0/1 strings, because if used in an arithmetic calculation, those are converted to integers (or rather numbers first), i.e. what your ~~ is doing. The result is again either 1 or 0 this time as an integer, which is converted to a string by writing the attribute, i.e. what your ~~(! is doing. Maybe you confused $F() - 1 with 1 - $F() what it actually was? -- Jan Schneider The Horde Project http://www.horde.org/ https://www.facebook.com/hordeproject -- dev mailing list Frequently Asked Questions: http://wiki.horde.org/FAQ To unsubscribe, mail: [email protected]