| Rev | Line | |
|---|
| [826] | 1 | |
|---|
| 2 | function getMaintenanceEntryForm(taskId, entryTypeId) { |
|---|
| 3 | |
|---|
| 4 | var p = {}; |
|---|
| 5 | for (var i = 0, j = arguments.length; i < j; i++){ |
|---|
| 6 | p[i] = arguments[i]; |
|---|
| 7 | } |
|---|
| 8 | |
|---|
| 9 | var actionUrl = getContextPath()+"/entryDetailed/ajaxCreate/"; |
|---|
| 10 | var container = jQuery('#maintenanceEntryContainer'); |
|---|
| 11 | var button = jQuery('#maintenanceEntryButton'); |
|---|
| 12 | var params = {taskId: taskId, entryTypeId: entryTypeId}; |
|---|
| 13 | |
|---|
| 14 | function success(data, textStatus, jqXHR){ |
|---|
| 15 | container.html(data); |
|---|
| 16 | jQuery('html,body').animate({scrollTop: container.offset().top}, 800, function() { |
|---|
| 17 | container.css("border", "1px solid #006DBA"); |
|---|
| 18 | container.find(':input[name="comment"]').focus(); |
|---|
| 19 | }); |
|---|
| 20 | } |
|---|
| 21 | |
|---|
| 22 | function error(jqXHR, textStatus, errorThrown){ |
|---|
| 23 | container.html(errorIndication().slideDown(600)); |
|---|
| 24 | button.show(600); |
|---|
| 25 | } |
|---|
| 26 | |
|---|
| 27 | // Start. |
|---|
| 28 | button.hide(600); |
|---|
| 29 | container.html(loadingIndication().slideDown(600)); |
|---|
| 30 | |
|---|
| 31 | jQuery.ajax({ |
|---|
| 32 | url: actionUrl, |
|---|
| 33 | data: params, |
|---|
| 34 | success: success, |
|---|
| 35 | error: error |
|---|
| 36 | }); |
|---|
| 37 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.