fix notes ui with new json.

This commit is contained in:
Keith Woodlock
2012-05-27 11:58:58 +01:00
parent 5e3678ed9f
commit 331c8831f9
2 changed files with 4 additions and 8 deletions
@@ -346,7 +346,6 @@ $(document).ready(function() {
}).dialog('open'); }).dialog('open');
} }
// function popupDialogWithFormView(getUrl, postUrl, submitType, titleCode, templateSelector, width, height, tabIndex, minOffset, defaultOffset, maxOffset) {
function popupDialogWithFormView(getUrl, postUrl, submitType, titleCode, templateSelector, width, height, saveSuccessFunction) { function popupDialogWithFormView(getUrl, postUrl, submitType, titleCode, templateSelector, width, height, saveSuccessFunction) {
var dialogDiv = $("<div id='dialog-form'></div>"); var dialogDiv = $("<div id='dialog-form'></div>");
var jqxhr = $.ajax({ var jqxhr = $.ajax({
@@ -356,11 +355,10 @@ $(document).ready(function() {
dataType: 'json', dataType: 'json',
cache: false, cache: false,
beforeSend: function(xhr) { beforeSend: function(xhr) {
console.log("base64: " + base64);
xhr.setRequestHeader("Authorization", "Basic " + base64); xhr.setRequestHeader("Authorization", "Basic " + base64);
}, },
success: function(data, textStatus, jqXHR) { success: function(data, textStatus, jqXHR) {
console.log(data);
var formHtml = $(templateSelector).render(data); var formHtml = $(templateSelector).render(data);
dialogDiv.append(formHtml); dialogDiv.append(formHtml);
@@ -389,7 +387,6 @@ $(document).ready(function() {
dataType: 'json', dataType: 'json',
data: newFormData, data: newFormData,
beforeSend: function(xhr) { beforeSend: function(xhr) {
console.log("base64: " + base64);
xhr.setRequestHeader("Authorization", "Basic " + base64); xhr.setRequestHeader("Authorization", "Basic " + base64);
}, },
success: saveSuccessFunction, success: saveSuccessFunction,
@@ -784,7 +781,6 @@ $(document).ready(function() {
dataType: 'json', dataType: 'json',
cache: false, cache: false,
beforeSend: function(xhr) { beforeSend: function(xhr) {
console.log("base64: " + base64);
xhr.setRequestHeader("Authorization", "Basic " + base64); xhr.setRequestHeader("Authorization", "Basic " + base64);
}, },
success: function(data, textStatus, jqXHR) { success: function(data, textStatus, jqXHR) {
@@ -792,7 +788,7 @@ $(document).ready(function() {
var noteParent = new Object(); var noteParent = new Object();
noteParent.title = jQuery.i18n.prop('widget.notes.heading'); noteParent.title = jQuery.i18n.prop('widget.notes.heading');
noteParent.items = data.notes; noteParent.notes = data;
var tableHtml = $("#noteListViewTemplate").render(noteParent); var tableHtml = $("#noteListViewTemplate").render(noteParent);
$("#clienttabrightpane").html(tableHtml); $("#clienttabrightpane").html(tableHtml);
@@ -265,7 +265,7 @@
</script> </script>
<script id="noteListViewTemplate" type="text/x-jquery-tmpl"> <script id="noteListViewTemplate" type="text/x-jquery-tmpl">
{{#if items.length > 0}} {{#if notes.length > 0}}
<div class="ui-widget .ui-widget-content ui-corner-all notecontainer"> <div class="ui-widget .ui-widget-content ui-corner-all notecontainer">
<div class="ui-widget-header"> <div class="ui-widget-header">
<span class="ui-icon ui-icon-info" style="float: left; margin-right: 5px;" ></span> <span class="ui-icon ui-icon-info" style="float: left; margin-right: 5px;" ></span>
@@ -273,7 +273,7 @@
</div> </div>
<div class="ui-widget ui-widget-content ui-corner-all"> <div class="ui-widget ui-widget-content ui-corner-all">
{{#each items}} {{#each notes}}
<div> <div>
<div class="notespacer"> <div class="notespacer">
<span class="ui-icon ui-icon-note" style="float: left; margin-right: 5px;"></span> <span class="ui-icon ui-icon-note" style="float: left; margin-right: 5px;"></span>