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

[6/8] git commit: updated refs/heads/4.2 to 99564b3

CLOUDSTACK-4102: UI > widget > extend dialog widget to have dynamic description.
(cherry picked from commit da54e06dd19f81e3de6a4050ffdf363970397ce1)

Signed-off-by: animesh <an...@apache.org>


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

Branch: refs/heads/4.2
Commit: 111f5754769cdbce52a02709ddc72c95a9fc057f
Parents: 1e0b5b5
Author: Jessica Wang <je...@apache.org>
Authored: Thu Aug 22 13:58:56 2013 -0700
Committer: animesh <an...@apache.org>
Committed: Thu Aug 22 15:29:55 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/111f5754/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/111f5754/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({