diff options
| author | Sanjay Gohel (Open ERP) <sgo@tinyerp.com> | 2012-04-06 16:42:10 +0530 |
|---|---|---|
| committer | Sanjay Gohel (Open ERP) <sgo@tinyerp.com> | 2012-04-06 16:42:10 +0530 |
| commit | c811ff3af5a6718c91ec99a082e46d00dbfb2741 (patch) | |
| tree | 9e1021fe272ec56e1fc94fc744a202c1052a0fd6 /addons | |
| parent | 6baa76220e74f2c27ef6ac2fded41d808641c21c (diff) | |
| parent | 2fc51533ad4278da75c666b00be874860ea5a314 (diff) | |
[MERGE]
bzr revid: sgo@tinyerp.com-20120406111210-o9ud9smsa2k3pkfm
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/project/project_view.xml | 2 | ||||
| -rw-r--r-- | addons/project/static/src/js/project.js | 54 |
2 files changed, 24 insertions, 32 deletions
diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index dd1f595b13d..7e12623783c 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -200,7 +200,7 @@ </t> </a> </h4> - <button class="click_button" type="object" t-att-id="record.id.value"> + <button class="click_button" type="object"> <table class="project_fields"> <tr id="deadline" t-if="record.date.raw_value"> <th align="left">Deadline</th> diff --git a/addons/project/static/src/js/project.js b/addons/project/static/src/js/project.js index a688d69de6d..38fc90893b5 100644 --- a/addons/project/static/src/js/project.js +++ b/addons/project/static/src/js/project.js @@ -2,38 +2,30 @@ openerp.project = function(openerp) { openerp.web_kanban.ProjectKanban = openerp.web_kanban.KanbanRecord.include({ bind_events: function() { self = this; - self._super(); - $('.dropdown-toggle').dropdown(); - $('.oe_project_kanban_vignette').mouseover(function() { - return $(this).find('.oe_project_kanban_action').show(); - }).mouseout(function() { - return $(this).find('.oe_project_kanban_action').hide(); - }); - - - $('.click_button').mouseover(function() { - click_button = this - var domain = [['id','=',this.getAttribute("id")]]; - var dataset = new openerp.web.DataSetSearch(self, 'project.project', self.session.context, domain); - dataset.read_slice([]).then(function(result){ - if(result[0].task){ - click_button.setAttribute('data-name','open_tasks'); - } - else - { - click_button.setAttribute('data-name','dummy'); - } - }); - }); - - $('.project_avatar').mouseover(function() { - avatar = this - var dataset = new openerp.web.DataSetSearch(this, 'res.users', self.session.context, [['id','=',avatar.getAttribute("id")]]); - dataset.read_slice([]).then(function(result){ - avatar.setAttribute("title",result[0].name) + if(this.view.dataset.model == 'project.project') { + //open dropdwon when click on the icon. + $('.dropdown-toggle').dropdown(); + + //show and hide the dropdown icon when mouseover and mouseour. + $('.oe_project_kanban_vignette').mouseover(function() { + return $(this).find('.oe_project_kanban_action').show(); + }).mouseout(function() { + return $(this).find('.oe_project_kanban_action').hide(); }); - }); - + + //set avatar title for members. + _.each($(this.$element).find('.project_avatar'),function(avatar){ + var dataset = new openerp.web.DataSetSearch(this, 'res.users', self.session.context, [['id','=',avatar.id]]); + dataset.read_slice([]).then(function(result){ + avatar.setAttribute("title",result[0].name) + }); + }); + + //if task is true , then open the task when clickd on the anywhere in the box. + if(this.record.task.raw_value)$(this.$element).find('.click_button').attr('data-name','open_tasks'); + if(!this.record.task.raw_value)$(this.$element).find('.click_button').attr('data-name','dummy'); + }; + self._super(); } }); } |
