diff options
| author | Arthur Maniet <arthurmaniet@me.com> | 2015-04-30 12:18:46 +0200 |
|---|---|---|
| committer | Arthur Maniet <arthurmaniet@me.com> | 2015-04-30 12:18:46 +0200 |
| commit | 7bede13b43927c1565184d463a89a17cbc4b9196 (patch) | |
| tree | daf08684d88ea0a45965df0d9a16f94e2e15b8fb /addons/web/static/src/js/framework/utils.js | |
| parent | e09ea0de92e0d6a6f302a85cc4ee62f1cb77ae69 (diff) | |
[ADD] web utils: xor function
Diffstat (limited to 'addons/web/static/src/js/framework/utils.js')
| -rw-r--r-- | addons/web/static/src/js/framework/utils.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/addons/web/static/src/js/framework/utils.js b/addons/web/static/src/js/framework/utils.js index 5caf995c988..393f3766bed 100644 --- a/addons/web/static/src/js/framework/utils.js +++ b/addons/web/static/src/js/framework/utils.js @@ -332,6 +332,11 @@ function assert (bool) { } } +/* Logical XOR */ +function xor (a, b) { + return (a && !b) || (!a && b); +} + var DropMisordered = Class.extend({ /** * @constructs instance.web.DropMisordered @@ -393,6 +398,7 @@ return { round_decimals: round_decimals, float_is_zero: float_is_zero, assert: assert, + xor: xor, DropMisordered: DropMisordered, }; |
