From f792e0ddc1976ce7f3e430618f86891c8cf9b3ae Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Tue, 11 Nov 2014 15:17:46 +0200 Subject: rz_core: split off view/node_info --- scripts/view/node_info.js | 63 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 scripts/view/node_info.js (limited to 'scripts/view') diff --git a/scripts/view/node_info.js b/scripts/view/node_info.js new file mode 100644 index 00000000..347fbb24 --- /dev/null +++ b/scripts/view/node_info.js @@ -0,0 +1,63 @@ +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, +}; + +}); -- cgit v1.3.1