define(['jquery', 'view/helpers'],
function($, view_helpers) {
function show(d) {
$('.info').fadeIn(300);
if (d.type === "deliverable") {
$('.info').html('Name: ' + d.id + '
');
} else if(d.type=== "chainlink"){
$('.info').html('Name: ' + d.id + '
');
}else{
$('.info').html('Name: ' + d.id + '
');
}
$('.info').css("border-color", view_helpers.customColor(d.type));
$("#editenddate").datepicker({
inline: true,
showOtherMonths: true,
dayNamesMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
});
$("#editstartdate").datepicker({
inline: true,
showOtherMonths: true,
dayNamesMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
});
$('#editdescription').val(d.type);
$('#edittype').val(d.type);
$('#editurl').val(d.url);
if (d.type === "deliverable") {
$('#editstartdate').val(d.start);
$('#editenddate').val(d.end);
}
}
function hide()
{
$('.info').fadeOut(300);
}
function on_submit(f)
{
$("#editbox").submit(f);
}
function on_delete(f)
{
$("#deletenode").click(f);
}
return {
show: show,
hide: hide,
on_submit: on_submit,
on_delete: on_delete,
};
});