You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by je...@apache.org on 2013/08/23 00:03:21 UTC

[2/3] git commit: updated refs/heads/4.2-forward to 3b63b22

CLOUDSTACK-4102: UI > widget > extend dialog widget to have dynamic description.


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

Branch: refs/heads/4.2-forward
Commit: da54e06dd19f81e3de6a4050ffdf363970397ce1
Parents: 52f08a4
Author: Jessica Wang <je...@apache.org>
Authored: Thu Aug 22 13:58:56 2013 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Thu Aug 22 15:03:06 2013 -0700

----------------------------------------------------------------------
 ui/scripts/ui/dialog.js             | 8 +++++++-
 ui/scripts/ui/widgets/detailView.js | 4 +++-
 2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/da54e06d/ui/scripts/ui/dialog.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/dialog.js b/ui/scripts/ui/dialog.js
index 1ff5401..4bbaf9c 100644
--- a/ui/scripts/ui/dialog.js
+++ b/ui/scripts/ui/dialog.js
@@ -46,8 +46,14 @@
             var createLabel = _l(args.form.createLabel);
 
             // Description text
+            var formDesc;
+            if (typeof(args.form.desc) == 'function') {            	
+            	formDesc = args.form.desc(args);
+            } else { //typeof(args.form.desc) == 'string' or 'undefined'
+            	formDesc = args.form.desc;
+            }              
             $('<span>').addClass('message').prependTo($formContainer).html(
-                _l(args.form.desc)
+                _l(formDesc)
             );
 
             // Submit button

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/da54e06d/ui/scripts/ui/widgets/detailView.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/detailView.js b/ui/scripts/ui/widgets/detailView.js
index 92dfe37..3a59d41 100644
--- a/ui/scripts/ui/widgets/detailView.js
+++ b/ui/scripts/ui/widgets/detailView.js
@@ -70,6 +70,7 @@
                 action.notification : {};
             var messages = action.messages;
             var id = args.id;
+            var jsonObj = args.jsonObj;
             var context = $.extend(true, {},
                 args.context ? args.context : $detailView.data('view-args').context);
             var _custom = $detailView.data('_custom');
@@ -314,7 +315,8 @@
                         ref: {
                             id: id
                         },
-                        context: context
+                        context: context,
+                        jsonObj: jsonObj
                     });
                 } else if (action.listView) {
                     cloudStack.dialog.listView({