cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jessicaw...@apache.org
Subject git commit: updated refs/heads/4.5 to 3ddf553
Date Sat, 06 Dec 2014 00:48:26 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.5 4f748e6e3 -> 3ddf553d1


CLOUDSTACK-8040: UI: register template dialog, register ISO dialog - fix a bug that hidden
fields fail to be generated before cloudStack.preFilter.createTemplate() is called. Thus,
cloudStack.preFilter.createTemplate() is unable to change hidden fields's css display property
from none to inline-block for admin users.


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

Branch: refs/heads/4.5
Commit: 3ddf553d164987ac61ebc499ad40f6b5614affa5
Parents: 4f748e6
Author: Jessica Wang <jessicawang@apache.org>
Authored: Fri Dec 5 16:47:34 2014 -0800
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Fri Dec 5 16:47:34 2014 -0800

----------------------------------------------------------------------
 ui/scripts/templates.js | 166 +++++++++++++++++++++----------------------
 1 file changed, 81 insertions(+), 85 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3ddf553d/ui/scripts/templates.js
----------------------------------------------------------------------
diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js
index 28145d5..1ca3214 100644
--- a/ui/scripts/templates.js
+++ b/ui/scripts/templates.js
@@ -408,20 +408,18 @@
                                     osTypeId: {
                                         label: 'label.os.type',
                                         docID: 'helpRegisterTemplateOSType',
-                                        select: function(args) {                        
               	
-                                        	if (ostypeObjs == undefined) {
-	                                            $.ajax({
-	                                                url: createURL("listOsTypes"),
-	                                                dataType: "json",
-	                                                async: false,
-	                                                success: function(json) {	             
                                  	
-	                                                	ostypeObjs = json.listostypesresponse.ostype;
                                                    
-	                                                }
-	                                            });
-                                        	}                                        	
-                                        	args.response.success({
-                                                data: ostypeObjs
-                                            });
+                                        select: function(args) {    
+                                            $.ajax({
+                                                url: createURL("listOsTypes"),
+                                                dataType: "json",
+                                                async: true,
+                                                success: function(json) {	              
                                 	
+                                                	var ostypeObjs = json.listostypesresponse.ostype;
+                                                	args.response.success({
+                                                        data: ostypeObjs
+                                                    });
+                                                }
+                                            });                                        	
   
                                         }
                                     },
 
@@ -845,16 +843,16 @@
                                     }
                                                                       
                                     if ('templates' in args.context && args.context.templates[0].ostypeid
!= undefined) {
-                                    	if (ostypeObjs == undefined) {
-        	                            	$.ajax({
-        	                                    url: createURL("listOsTypes"),
-        	                                    dataType: "json",
-        	                                    async: false,
-        	                                    success: function(json) {	                 
                  	
-        	                                    	ostypeObjs = json.listostypesresponse.ostype;
	                                    	
-        	                                    }
-        	                                });
-                                    	}                            	
+                                    	var ostypeObjs;
+    	                            	$.ajax({
+    	                                    url: createURL("listOsTypes"),
+    	                                    dataType: "json",
+    	                                    async: false,
+    	                                    success: function(json) {	                     
              	
+    	                                    	var ostypeObjs = json.listostypesresponse.ostype;
	                                    	
+    	                                    }
+    	                                });
+                                    	                           	
                                     	if (ostypeObjs != undefined) {
                                     		var ostypeName;
                                     		for (var i = 0; i < ostypeObjs.length; i++) {
@@ -959,16 +957,16 @@
                                         label: 'label.os.type',
                                         isEditable: true,
                                         select: function(args) {
-                                        	if (ostypeObjs == undefined) {
-	                                            $.ajax({
-	                                                url: createURL("listOsTypes"),
-	                                                dataType: "json",
-	                                                async: false,
-	                                                success: function(json) {	             
                                  	
-	                                                	ostypeObjs = json.listostypesresponse.ostype;
                                                   
-	                                                }
-	                                            });
-                                        	}                                        	
+                                        	var ostypeObjs;
+                                            $.ajax({
+                                                url: createURL("listOsTypes"),
+                                                dataType: "json",
+                                                async: false,
+                                                success: function(json) {	              
                                 	
+                                                	ostypeObjs = json.listostypesresponse.ostype;
                                                   
+                                                }
+                                            });
+                                        	                                        	
                                         	var items = [];
                                             $(ostypeObjs).each(function() {
                                                 items.push({
@@ -1226,16 +1224,16 @@
                                                 }
                                                                                         
      
                                                 if ('templates' in args.context &&
args.context.templates[0].ostypeid != undefined) {
-                                                	if (ostypeObjs == undefined) {
-                    	                            	$.ajax({
-                    	                                    url: createURL("listOsTypes"),
-                    	                                    dataType: "json",
-                    	                                    async: false,
-                    	                                    success: function(json) {	     
                              	
-                    	                                    	ostypeObjs = json.listostypesresponse.ostype;
	                                    	
-                    	                                    }
-                    	                                });
-                                                	}                            	
+                                                	var ostypeObjs;
+                	                            	$.ajax({
+                	                                    url: createURL("listOsTypes"),
+                	                                    dataType: "json",
+                	                                    async: false,
+                	                                    success: function(json) {	         
                          	
+                	                                    	ostypeObjs = json.listostypesresponse.ostype;
	                                    	
+                	                                    }
+                	                                });
+                                                	                           	
                                                 	if (ostypeObjs != undefined) {
                                                 		var ostypeName;
                                                 		for (var i = 0; i < ostypeObjs.length;
i++) {
@@ -1357,16 +1355,16 @@
                                                     label: 'label.os.type',
                                                     isEditable: true,
                                                     select: function(args) {            
                                       
-                                                    	if (ostypeObjs == undefined) {     

-	                                                        $.ajax({
-	                                                            url: createURL("listOsTypes"),
-	                                                            dataType: "json",
-	                                                            async: false,
-	                                                            success: function(json) {
-	                                                            	ostypeObjs = json.listostypesresponse.ostype;
                                                                
-	                                                            }
-	                                                        });
-                                                    	}                                  
                 
+                                                    	var ostypeObjs;
+                                                        $.ajax({
+                                                            url: createURL("listOsTypes"),
+                                                            dataType: "json",
+                                                            async: false,
+                                                            success: function(json) {
+                                                            	ostypeObjs = json.listostypesresponse.ostype;
                                                                
+                                                            }
+                                                        });
+                                                    	                                   
                
                                                     	var items = [];
                                                         $(ostypeObjs).each(function() {
                                                             items.push({
@@ -1560,27 +1558,25 @@
                                             required: true
                                         },
                                         select: function(args) {
-                                        	if (ostypeObjs == undefined) {   
-	                                            $.ajax({
-	                                                url: createURL("listOsTypes"),
-	                                                dataType: "json",
-	                                                async: false,
-	                                                success: function(json) {
-	                                                    ostypeObjs = json.listostypesresponse.ostype;
                                                    
-	                                                }
-	                                            });
-                                        	}
-                                        	var items = [];
-                                            //items.push({id: "", description: "None"});
//shouldn't have None option when bootable is checked
-                                            $(ostypeObjs).each(function() {
-                                                items.push({
-                                                    id: this.id,
-                                                    description: this.description
-                                                });
-                                            });
-                                            args.response.success({
-                                                data: items
-                                            });
+                                        	$.ajax({
+                                                url: createURL("listOsTypes"),
+                                                dataType: "json",
+                                                async: true,
+                                                success: function(json) {
+                                                    var ostypeObjs = json.listostypesresponse.ostype;

+                                                    var items = [];
+                                                    //items.push({id: "", description: "None"});
//shouldn't have None option when bootable is checked
+                                                    $(ostypeObjs).each(function() {
+                                                        items.push({
+                                                            id: this.id,
+                                                            description: this.description
+                                                        });
+                                                    });
+                                                    args.response.success({
+                                                        data: items
+                                                    });
+                                                }
+                                            });                                        	
                                       	
                                         }
                                     },
 
@@ -2277,16 +2273,16 @@
                                                     label: 'label.os.type',
                                                     isEditable: true,
                                                     select: function(args) {
-                                                    	if (ostypeObjs == undefined) {  
-	                                                        $.ajax({
-	                                                            url: createURL("listOsTypes"),
-	                                                            dataType: "json",
-	                                                            async: false,
-	                                                            success: function(json) {
-	                                                            	ostypeObjs = json.listostypesresponse.ostype;
                                                                
-	                                                            }
-	                                                        });
-                                                    	}
+                                                    	var ostypeObjs;
+                                                        $.ajax({
+                                                            url: createURL("listOsTypes"),
+                                                            dataType: "json",
+                                                            async: false,
+                                                            success: function(json) {
+                                                            	ostypeObjs = json.listostypesresponse.ostype;
                                                                
+                                                            }
+                                                        });
+                                                	
                                                     	var items = [];
                                                         $(ostypeObjs).each(function() {
                                                             items.push({


Mime
View raw message