From 5f16b2e40ca670ebfbd6e8594050bd9841a86182 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 4 Apr 2012 11:33:48 -0700 Subject: [PATCH] cloudstack 3.0 UI - global settings page - fix a bug that "value" column turned blank when Save button is being clicked. --- ui/scripts/ui/widgets/listView.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/ui/scripts/ui/widgets/listView.js b/ui/scripts/ui/widgets/listView.js index 8d3294be6cd..a6b5f6c4a73 100644 --- a/ui/scripts/ui/widgets/listView.js +++ b/ui/scripts/ui/widgets/listView.js @@ -9,7 +9,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -// Automatically generated by addcopyright.py at 04/02/2012 +// Automatically generated by addcopyright.py at 04/03/2012 /** * Create dynamic list view based on data callbacks */ @@ -373,7 +373,9 @@ if (!options) options = {}; var oldVal = $label.html(); - $label.html(_s(val)); + + if(val != null ) + $label.html(_s(val)); var data = { id: $instanceRow.data('list-view-item-id'), @@ -411,15 +413,16 @@ } }); }; - - if (args.cancel) { + + if (args.cancel) { //click Cancel button showLabel(); return false; } - - if (!$editInput.is(':visible')) { + + if (!$editInput.is(':visible') || !(typeof(args.action) == 'undefined')) { //click Edit button showEditField(); - } else if ($editInput.val() != $label.html()) { + } + else if ($editInput.val() != $label.html()) { //click Save button with changed value $edit.animate({ opacity: 0.5 }); var originalName = $label.html(); @@ -442,7 +445,8 @@ ); } }); - } else { + } + else { //click Save button with unchanged value showLabel(); }