You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2014/07/28 16:04:42 UTC
[30/50] git commit: updated refs/heads/4.4 to d5220a8
CLOUDSTACK-6936: UI - (1)dialog widget > dropdown field > provide a blank option if there is no data for option(s) in a dropdown field. (2) Add Primary Storage dialog - cluster dropdown field - still calls args.response.success() when there is no data for option(s).
(cherry picked from commit b8a29615838bd12d0f6699ef3e64bb9b89158c26)
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e988c917
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e988c917
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e988c917
Branch: refs/heads/4.4
Commit: e988c917c65504a153a353e6981c2b05c7d9186c
Parents: b56246c
Author: Jessica Wang <je...@apache.org>
Authored: Wed Jun 18 12:20:43 2014 -0700
Committer: Daan Hoogland <da...@onecht.net>
Committed: Mon Jul 28 16:02:40 2014 +0200
----------------------------------------------------------------------
ui/scripts/system.js | 10 ++++++----
ui/scripts/ui/dialog.js | 6 ++++++
2 files changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e988c917/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index a366754..e6fb7a6 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -15436,17 +15436,19 @@
dependsOn: 'clusterId',
select: function (args) {
var clusterId = args.clusterId;
- if (clusterId == null)
+ if (clusterId == null || clusterId.length == 0) {
+ args.response.success({
+ data: []
+ });
return;
- var items =[];
+ }
+
$(clusterObjs).each(function () {
if (this.id == clusterId) {
selectedClusterObj = this;
return false; //break the $.each() loop
}
});
- if (selectedClusterObj == null)
- return;
if (selectedClusterObj.hypervisortype == "KVM") {
var items =[];
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e988c917/ui/scripts/ui/dialog.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/dialog.js b/ui/scripts/ui/dialog.js
index 7a903fd..0fddcf7 100644
--- a/ui/scripts/ui/dialog.js
+++ b/ui/scripts/ui/dialog.js
@@ -271,6 +271,11 @@
context: args.context,
response: {
success: function(args) {
+ if (args.data == undefined || args.data.length == 0) {
+ var $option = $('<option>')
+ .appendTo($input)
+ .html("");
+ } else {
$(args.data).each(function() {
var id;
if (field.valueField)
@@ -290,6 +295,7 @@
.data('json-obj', this)
.html(_s(desc));
});
+ }
if (field.defaultValue) {
$input.val(_s(strOrFunc(field.defaultValue, args.data)));