From 5e1413aca654901cdabb93c72e9a32e4da0320da Mon Sep 17 00:00:00 2001 From: "Amit Patel (OpenERP)" Date: Tue, 8 May 2012 16:16:07 +0530 Subject: [PATCH] [IMP]:improved js code. bzr revid: apa@tinyerp.com-20120508104607-w3q12gphejt3zauw --- addons/project/static/src/js/project.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/project/static/src/js/project.js b/addons/project/static/src/js/project.js index cc228e5e931..d00b0762f86 100644 --- a/addons/project/static/src/js/project.js +++ b/addons/project/static/src/js/project.js @@ -26,10 +26,12 @@ openerp.project = function(openerp) { $('#list').replaceWith(my_list); //it opens action in sequence which ever is first. + if (my_list.length!=0){ - $(this.$element).find('.click_button').attr('data-name',my_list[0].getAttribute('data-name')); - if(isNaN(parseInt($(this.$element).find('.click_button').attr('data-name')))){ - $(this.$element).find('.click_button').attr('data-type',"object") + click_button = $(this.$element).find('.click_button') + click_button.attr('data-name',my_list[0].getAttribute('data-name')); + if(isNaN(parseInt(click_button.attr('data-name')))){ + click_button.attr('data-type',"object") } } /* set background color.