cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [1/3] git commit: CB-2500: handle multiple concurrent alerts
Date Mon, 01 Apr 2013 22:39:24 GMT
Updated Branches:
  refs/heads/2.6.x a7ff6a09d -> 87e0d98b8


CB-2500: handle multiple concurrent alerts

Walk up the parent's chain of OK buttons until we meet the NotificationBox
object and remove that object from the root grid.


Project: http://git-wip-us.apache.org/repos/asf/cordova-wp8/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-wp8/commit/59555ed0
Tree: http://git-wip-us.apache.org/repos/asf/cordova-wp8/tree/59555ed0
Diff: http://git-wip-us.apache.org/repos/asf/cordova-wp8/diff/59555ed0

Branch: refs/heads/2.6.x
Commit: 59555ed013715a031762ce466095f52c35c71a92
Parents: 066d798
Author: Marcel Kinard <cmarcelk@gmail.com>
Authored: Wed Feb 20 08:25:32 2013 -0500
Committer: Marcel Kinard <cmarcelk@gmail.com>
Committed: Wed Feb 20 08:25:32 2013 -0500

----------------------------------------------------------------------
 .../standalone/cordovalib/Commands/Notification.cs |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/59555ed0/templates/standalone/cordovalib/Commands/Notification.cs
----------------------------------------------------------------------
diff --git a/templates/standalone/cordovalib/Commands/Notification.cs b/templates/standalone/cordovalib/Commands/Notification.cs
index 0caca97..92f8a6b 100644
--- a/templates/standalone/cordovalib/Commands/Notification.cs
+++ b/templates/standalone/cordovalib/Commands/Notification.cs
@@ -177,12 +177,17 @@ namespace WPCordovaClassLib.Cordova.Commands
         void btnOK_Click(object sender, RoutedEventArgs e)
         {
             Button btn = sender as Button;
+            FrameworkElement notifBoxParent = null;
             int retVal = 0;
             if (btn != null)
             {
                 retVal = (int)btn.Tag + 1;
+
+                notifBoxParent = btn.Parent as FrameworkElement;
+                while ((notifBoxParent = notifBoxParent.Parent as FrameworkElement) != null
&&
+                        !(notifBoxParent is NotificationBox)) ;
             }
-            if (notifBox != null)
+            if (notifBoxParent != null)
             {
                 PhoneApplicationPage page = Page;
                 if (page != null)
@@ -190,7 +195,7 @@ namespace WPCordovaClassLib.Cordova.Commands
                     Grid grid = page.FindName("LayoutRoot") as Grid;
                     if (grid != null)
                     {
-                        grid.Children.Remove(notifBox);
+                        grid.Children.Remove(notifBoxParent);
                     }
                 }
                 notifBox = null;


Mime
View raw message