[dev] [commits] Horde branch master updated. b2212fa6f30df255024a450c8b98491d1e03049d
Jan Schneider
jan at horde.org
Wed Apr 16 08:34:52 UTC 2014
> commit f708a22e6ba28f52644df950adf1961ad96050ae
> Author: Michael M Slusarz <slusarz at horde.org>
> 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
More information about the dev
mailing list