TizenWinset : bug fix(N_SE-36666)
authorJinhyuk Jun <jinhyuk.jun@samsung.com>
Tue, 30 Apr 2013 04:56:05 +0000 (13:56 +0900)
committerhjnim.kim <hjnim.kim@samsung.com>
Fri, 3 May 2013 06:29:07 +0000 (15:29 +0900)
close popup only current popup is active(ui-popup-active)

Change-Id: Id7a85b378d00b19311ba7f6137d0a574eee35f47

demos/tizen-winsets/widgets/popupwindow/popupwindow.js

index f62f272..f505747 100644 (file)
@@ -15,14 +15,17 @@ $( document ).one( "pageinit", "#popupwindow-demo", function () {
 
 function onSuccessPopupCallback ( ori ) {
         if ( ori.status === "PORTRAIT_PRIMARY" || ori.status === "PORTRAIT_SECONDARY" ) {
-               $("#textbox_popup_landscape").popup("close");
-               $("#go_textbox_popup a").attr("href", "#textbox_popup");
+                if( $( "#textbox_popup_landscape" ).parents( ".ui-popup-container" ).is( ".ui-popup-active" ) ) {
+                        $( "#textbox_popup_landscape" ).popup( "close" );
+                }
+               $( "#go_textbox_popup a" ).attr( "href", "#textbox_popup" );
         }
         else if ( ori.status === "LANDSCAPE_PRIMARY" || ori.status === "LANDSCAPE_SECONDARY" ) {
-               $("#textbox_popup").popup("close");
-               $("#go_textbox_popup a").attr("href", "#textbox_popup_landscape");
+                if( $( "#textbox_popup" ).parents( ".ui-popup-container" ).is( ".ui-popup-active" ) ) {
+                        $( "#textbox_popup" ).popup( "close" );
+                }
+                $( "#go_textbox_popup a" ).attr( "href", "#textbox_popup_landscape" );
         }
-
 }
 
 function onErrorPopupCallback ( error ) {