[IMP] replace literal values by symbolic ones for node types dispatching
authorXavier Morel <xmo@openerp.com>
Thu, 16 May 2013 11:03:35 +0000 (13:03 +0200)
committerXavier Morel <xmo@openerp.com>
Thu, 16 May 2013 11:03:35 +0000 (13:03 +0200)
bzr revid: xmo@openerp.com-20130516110335-dk803tjn1qpqd0ro

addons/web/static/src/js/coresetup.js

index fd1ace3..6fc8373 100644 (file)
@@ -555,8 +555,8 @@ instance.web.qweb.default_dict = {
 instance.web.qweb.preprocess_node = function() {
     // Note that 'this' is the Qweb Node
     switch (this.node.nodeType) {
-        case 3:
-        case 4:
+        case Node.TEXT_NODE:
+        case Node.CDATA_SECTION_NODE:
             // Text and CDATAs
             var translation = this.node.parentNode.attributes['t-translation'];
             if (translation && translation.value === 'off') {
@@ -567,7 +567,7 @@ instance.web.qweb.preprocess_node = function() {
                 this.node.data = match[1] + instance.web._t(match[2]) + match[3];
             }
             break;
-        case 1:
+        case Node.ELEMENT_NODE:
             // Element
             var attr, attrs = ['label', 'title', 'alt', 'placeholder'];
             while (attr = attrs.pop()) {