OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/assets/javascripts/impediment.js

41 lines
1.2 KiB

/**************************************
IMPEDIMENT
***************************************/
RB.Impediment = RB.Object.create(RB.Task, {
initialize: function(el){
var j; // This ensures that we use a local 'j' variable, not a global one.
this.$ = j = $(el);
this.el = el;
j.addClass("impediment"); // If node is based on #task_template, it doesn't have the impediment class yet
// Associate this object with the element for later retrieval
j.data('this', this);
j.bind('mouseup', this.handleClick);
},
// Override saveDirectives of RB.Task
saveDirectives: function(){
var j = this.$;
var prev = this.$.prev();
var statusID = j.parent('td').first().attr('id').split("_")[1];
var data = j.find('.editor').serialize() +
"&is_impediment=true" +
"&fixed_version_id=" + RB.constants['sprint_id'] +
"&status_id=" + statusID +
"&prev=" + (prev.length==1 ? prev.data('this').getID() : '') +
(this.isNew() ? "" : "&id=" + j.children('.id').text());
var url = RB.urlFor[(this.isNew() ? 'create_task' : 'update_task')];
return {
url: url,
data: data
}
}
});