summaryrefslogtreecommitdiff
path: root/addons/project/static/src
diff options
context:
space:
mode:
authorRaphael Collet <rco@openerp.com>2012-05-09 08:55:22 +0200
committerRaphael Collet <rco@openerp.com>2012-05-09 08:55:22 +0200
commit7dab19c32b6a8303711cdfb6d5da5d96d177e43d (patch)
treec1fe244a03f0150cc73ca71379e756124bfc0e85 /addons/project/static/src
parente9d359a7ed408b886012c021357a8e328586e1c9 (diff)
[IMP] project: small code cleanup for project kanban view
bzr revid: rco@openerp.com-20120509065522-16ouzxqiwqgjdcyd
Diffstat (limited to 'addons/project/static/src')
-rw-r--r--addons/project/static/src/js/project.js23
1 files changed, 10 insertions, 13 deletions
diff --git a/addons/project/static/src/js/project.js b/addons/project/static/src/js/project.js
index b7c37d9671e..09a7c9eb256 100644
--- a/addons/project/static/src/js/project.js
+++ b/addons/project/static/src/js/project.js
@@ -1,7 +1,7 @@
openerp.project = function(openerp) {
openerp.web_kanban.ProjectKanban = openerp.web_kanban.KanbanRecord.include({
bind_events: function() {
- self = this;
+ var self = this;
self._super();
if(this.view.dataset.model == 'project.project') {
@@ -17,7 +17,7 @@ openerp.project = function(openerp) {
});
// set sequence like Tasks,Issues,Timesheets and Phases
- my_list = $("#list a")
+ var my_list = $("#list a")
my_list.sort(function (a, b) {
var aValue = parseInt(a.id);
var bValue = parseInt(b.id);
@@ -25,27 +25,24 @@ openerp.project = function(openerp) {
});
$('#list').replaceWith(my_list);
- //it opens action in sequence which ever is first.
- click_button = $(this.$element).find('.click_button')
- if (my_list.length!=0){
- click_button.attr('data-name',my_list[0].getAttribute('data-name'));
+ // when vignette is clicked, it opens the first action in sequence
+ if (my_list.length != 0) {
+ var click_button = $(this.$element).find('.click_button')
+ click_button.attr('data-name', my_list[0].getAttribute('data-name'));
+ click_button.attr('data-type', "action");
}
- else{
- click_button.attr('data-name','dummy');
- }
- if(isNaN(parseInt(click_button.attr('data-name'))))click_button.attr('data-type',"object");
/* set background color.
we can do other way to implement new widget.
because we need to rpc call for that.
*/
this.$element.find('.bgcolor').click(function(){
- color = parseInt($(this).find('span').attr('class').split(' ')[0].substring(16))
- color_class = $(this).find('span').attr('class').split(' ')[0]
+ var color = parseInt($(this).find('span').attr('class').split(' ')[0].substring(16))
+ var color_class = $(this).find('span').attr('class').split(' ')[0]
$(this).closest('#oe_project_kanban_vignette').removeClass().addClass(color_class + ' oe_project_kanban_vignette');
self.view.dataset.write(parseInt(this.id), {color:color});
});
- };
+ }
}
});
}