diff options
Diffstat (limited to 'addons/web_process/static/src')
| -rw-r--r-- | addons/web_process/static/src/js/process.js | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/addons/web_process/static/src/js/process.js b/addons/web_process/static/src/js/process.js index 75a8891fb6b..cd30dad1f13 100644 --- a/addons/web_process/static/src/js/process.js +++ b/addons/web_process/static/src/js/process.js @@ -4,7 +4,6 @@ openerp.web_process = function (openerp) { openerp.web.ViewManager.include({ start: function() { this._super(); - var self = this; this.process_check(); this.process_help = this.action ? this.action.help : 'Help: Not Defined'; this.model = this.dataset.model; @@ -83,8 +82,7 @@ openerp.web_process = function (openerp) { return def.promise(); }, help : function() { - var self = this, - def = $.Deferred(); + var def = $.Deferred(); if(!this.subflow_model) { def.resolve(this.action ? (this.action.help!=false ? this.action.help : 'Help: Not Defined') : 'Help: Not Defined'); } else { @@ -147,24 +145,14 @@ openerp.web_process = function (openerp) { var self = this, process_graph = new Graph(); var process_renderer = function(r, n) { - var process_node, - process_node_text, - process_node_desc, - process_set; - - var node_button, - node_menu, - img_src; - - var bg = "node", - clip_rect = "".concat(n.node.x,",",n.node.y,",150,100"); + var clip_rect = "".concat(n.node.x,",",n.node.y,",150,100"); //Image part - bg = n.node.kind == "subflow" ? "node-subflow" : "node"; + var bg = n.node.kind == "subflow" ? "node-subflow" : "node"; bg = n.node.gray ? bg + "-gray" : bg; bg = n.node.active ? 'node-current': bg; - img_src = '/web_process/static/src/img/'+ bg + '.png'; + var img_src = '/web_process/static/src/img/'+ bg + '.png'; r['image'](img_src, n.node.x, n.node.y,150, 100) .attr({"clip-rect": clip_rect}) @@ -172,9 +160,9 @@ openerp.web_process = function (openerp) { return false; }); //Node - process_node = r['rect'](n.node.x, n.node.y, 150, 100).attr({stroke: "none"}); + var process_node = r['rect'](n.node.x, n.node.y, 150, 100).attr({stroke: "none"}); // Node text - process_node_text = r.text(n.node.x, n.node.y, (n.node.name)) + var process_node_text = r.text(n.node.x, n.node.y, (n.node.name)) .attr({"fill": "#fff", "font-weight": "bold", "cursor": "pointer"}); process_node_text.translate((process_node.getBBox().width / 2) + 5, 10); if(n.node.subflow) { @@ -186,9 +174,10 @@ openerp.web_process = function (openerp) { }); } //Node Description - new_notes = n.node.notes; + var new_notes = n.node.notes; if(n.node.notes.length > 25) { - var new_notes= temp_str = ''; + var to; + var temp_str = new_notes = ''; var from = to = 0; while (1) { from = 25; @@ -205,7 +194,7 @@ openerp.web_process = function (openerp) { if(n.node.res) new_notes = n.node.res.name + '\n' + new_notes; - process_node_desc = r.text(n.node.x+85, n.node.y+50, (new_notes)); + r.text(n.node.x+85, n.node.y+50, (new_notes)); r['image']('/web/static/src/img/icons/gtk-info.png', n.node.x+20, n.node.y+70, 16, 16) .attr({"cursor": "pointer", "title": "Help"}) .click(function() { @@ -220,7 +209,7 @@ openerp.web_process = function (openerp) { }); } - process_set = r.set().push(process_node); + var process_set = r.set().push(process_node); process_set.mousedown(function() { return false; }); |
