incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [1/2] git commit: Detail view/list view: Pass context to confirm messages
Date Tue, 13 Nov 2012 18:52:37 GMT
Updated Branches:
  refs/heads/master 792c6c008 -> 70a5a2232


Detail view/list view: Pass context to confirm messages


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

Branch: refs/heads/master
Commit: 456202162cd3c6095bdd27aa011613e232af4c0e
Parents: 792c6c0
Author: Brian Federle <brian.federle@citrix.com>
Authored: Tue Nov 13 10:37:39 2012 -0800
Committer: Brian Federle <brian.federle@citrix.com>
Committed: Tue Nov 13 10:52:32 2012 -0800

----------------------------------------------------------------------
 ui/scripts/ui/widgets/detailView.js |    5 ++++-
 ui/scripts/ui/widgets/listView.js   |   13 +++++++++----
 2 files changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/45620216/ui/scripts/ui/widgets/detailView.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/detailView.js b/ui/scripts/ui/widgets/detailView.js
index 4fc2689..60fbfb9 100644
--- a/ui/scripts/ui/widgets/detailView.js
+++ b/ui/scripts/ui/widgets/detailView.js
@@ -62,13 +62,16 @@
       var notification = action.notification ?
             action.notification : {};
       var messages = action.messages;
-      var messageArgs = { name: $detailView.find('tr.name td.value').html() };
       var id = args.id;
       var context = $detailView.data('view-args').context;
       var _custom = $detailView.data('_custom');
       var customAction = action.action.custom;
       var noAdd = action.noAdd;
       var noRefresh = additional.noRefresh;
+      var messageArgs = {
+        name: $detailView.find('tr.name td.value').html(),
+        context: context
+      };
 
       // Handle pre-action (occurs before any other behavior happens)
       if (preAction) {

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/45620216/ui/scripts/ui/widgets/listView.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/listView.js b/ui/scripts/ui/widgets/listView.js
index 5281785..f7f7457 100644
--- a/ui/scripts/ui/widgets/listView.js
+++ b/ui/scripts/ui/widgets/listView.js
@@ -23,7 +23,6 @@
       var listViewArgs = $instanceRow.closest('div.list-view').data('view-args');
       var notification = args.action.notification ? args.action.notification : {};
       var messages = args.action ? args.action.messages : {};
-      var messageArgs = { name: $instanceRow.find('td.name span').html() };
       var preAction = args.action ? args.action.preAction : {};
       var action = args.action ? args.action.action : {};
       var section;
@@ -32,6 +31,9 @@
         jsonObj: $instanceRow.data('jsonObj')
       };
       var $listView = $instanceRow.closest('.list-view');
+      var messageArgs = {
+        name: $instanceRow.find('td.name span').html()
+      };
 
       if (args.data) $.extend(true, data, args.data);
       if (listViewArgs) section = listViewArgs.section;
@@ -269,14 +271,17 @@
       };
 
       var context = $.extend({}, listViewArgs.context);
+      
       context[
         listViewArgs.activeSection
       ] = [$instanceRow.data('jsonObj')];
 
+      messageArgs.context = context;     
+
       if (!args.action.action.externalLink &&
           !args.action.createForm &&
           args.action.addRow != 'true' &&
-          !action.custom && !action.uiCustom)
+          !action.custom && !action.uiCustom) {
         cloudStack.dialog.confirm({
           message: messages.confirm(messageArgs),
           action: function() {
@@ -287,9 +292,9 @@
             });
           }
         });
-      else if (action.custom || action.uiCustom)
+      } else if (action.custom || action.uiCustom) {
         performAction();
-      else {
+      } else {
         var addRow = args.action.addRow == "false" ? false : true;
         var isHeader = args.action.isHeader;
         var createFormContext = $.extend({}, context);


Mime
View raw message