cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kis...@apache.org
Subject [01/50] [abbrv] git commit: updated refs/heads/network_acl to 1609d01
Date Fri, 03 May 2013 13:14:43 GMT
Updated Branches:
  refs/heads/network_acl 8471a753b -> 1609d0195 (forced update)


CLOUDSTACK-2074: UI - affinity groups - VM wizard under Affinity Groups menu - step 5(select
affinity group step) - make corresponding affinity group checked by default.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/996d2f5a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/996d2f5a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/996d2f5a

Branch: refs/heads/network_acl
Commit: 996d2f5a2ba9f9af1c9976dd1598655bc258b720
Parents: 38071e6
Author: Jessica Wang <jessicawang@apache.org>
Authored: Wed May 1 13:57:20 2013 -0700
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Wed May 1 14:07:23 2013 -0700

----------------------------------------------------------------------
 ui/scripts/instanceWizard.js           |   10 ++++++++-
 ui/scripts/ui-custom/instanceWizard.js |   30 ++++++++++++++++++---------
 2 files changed, 29 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/996d2f5a/ui/scripts/instanceWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/instanceWizard.js b/ui/scripts/instanceWizard.js
index f3deb66..ff130d3 100644
--- a/ui/scripts/instanceWizard.js
+++ b/ui/scripts/instanceWizard.js
@@ -317,7 +317,15 @@
 				  url: createURL('listAffinityGroups'),
 					success: function(json) {					 
 					  var items = json.listaffinitygroupsresponse.affinitygroup;
-						args.response.success({data: {affinityGroups: items}});
+					  var data = { 
+					    affinityGroups: items 
+					  };
+					  if('affinityGroups' in args.context) {
+					    $.extend(data, {
+					      selectedObj: args.context.affinityGroups[0]
+					    });					    
+					  }					  
+						args.response.success({data: data});
 					}
 				});		
       },

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/996d2f5a/ui/scripts/ui-custom/instanceWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/instanceWizard.js b/ui/scripts/ui-custom/instanceWizard.js
index bdc05c1..ea7acf8 100644
--- a/ui/scripts/ui-custom/instanceWizard.js
+++ b/ui/scripts/ui-custom/instanceWizard.js
@@ -86,7 +86,7 @@
           });
         };
 
-        var makeSelects = function(name, data, fields, options) {
+        var makeSelects = function(name, data, fields, options, selectedObj) {
           var $selects = $('<div>');
           options = options ? options : {};
 
@@ -151,7 +151,11 @@
                       .append($('<div>').addClass('desc').html(_s(this[fields.desc])))
                   )
                   .data('json-obj', this);
-
+            
+            if(selectedObj != null && selectedObj.id == item.id) {              
 
+              $select.find('input[type=checkbox]').attr('checked', 'checked');          

+            }                        
+            
             $selects.append($select);
 
             if (item._singleSelect) {
@@ -493,14 +497,20 @@
                       )
                     );
                     $step.find('.select-container').append(
-                      makeSelects('affinity-groups', args.data.affinityGroups, {
-                        name: 'name',
-                        desc: 'description',
-                        id: 'id'
-                      }, {
-                        type: 'checkbox',
-                        'wizard-field': 'affinity-groups'
-                      })
+                      makeSelects(
+                        'affinity-groups', 
+                        args.data.affinityGroups, 
+                        {
+                          name: 'name',
+                          desc: 'description',
+                          id: 'id'
+                        }, 
+                        {
+                          type: 'checkbox',
+                          'wizard-field': 'affinity-groups'
+                        },
+                        args.data.selectedObj
+                      )
                     ); 
                   } else {
                     $step.find('.select-container').append($('<p>').html(_l('message.no.affinity.groups')));


Mime
View raw message