summaryrefslogtreecommitdiff
path: root/addons/base_graph/static/src
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2011-06-17 11:24:36 +0200
committerXavier Morel <xmo@openerp.com>2011-06-17 11:24:36 +0200
commitc5e061fec9bc1594f7a99e26970ecf12211ed95f (patch)
tree35c9f9bb21e764936f937ff54a303350c099d883 /addons/base_graph/static/src
parent933272263b1192817a857928af89a7a7fa76510b (diff)
[FIX] don't make explicit boolean comparisons without identity
In javascript, '0 == false', '1 == true' and even '"1" == true'. Either use variables directly in a boolean context, or use type-strict equality (===) to ensure the variable is an actual boolean, not some other type coerced to a boolean bzr revid: xmo@openerp.com-20110617092436-s8b5v4v5ytbonvi1
Diffstat (limited to 'addons/base_graph/static/src')
-rw-r--r--addons/base_graph/static/src/js/graph.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/base_graph/static/src/js/graph.js b/addons/base_graph/static/src/js/graph.js
index e0a3c1feeea..7a9073996e9 100644
--- a/addons/base_graph/static/src/js/graph.js
+++ b/addons/base_graph/static/src/js/graph.js
@@ -250,7 +250,7 @@ openerp.base_graph.GraphView = openerp.base.Controller.extend({
template:function(obj){
if(x_ax['template']){
var val = obj[x_ax['template']];
- val = (typeof val == 'object')?val[1]:(val==false?'Undefined':val);
+ val = (typeof val == 'object')?val[1]:(!val?'Undefined':val);
return val;
}else{
return obj;
@@ -263,7 +263,7 @@ openerp.base_graph.GraphView = openerp.base.Controller.extend({
template:function(obj){
if(y_ax['template']){
var vals = obj[y_ax['template']];
- vals = (typeof vals == 'object')?vals[1]:(vals==false?'Undefined':vals);
+ vals = (typeof vals == 'object')?vals[1]:(!vals?'Undefined':vals);
return vals;
}else{
return obj;