1 $( document ).one( "pageinit", "#popupwindow-demo", function () {
2 $("#btn_textbox_popup_cancel").on("vclick", function ( ev ) {
3 $("#textbox_popup").find("input").val("");
4 $("#textbox_popup").popup("close");
8 if ( $.tizen.__tizen__.util.isMobileBrowser() ) {
9 var direction = window.screen.orientation;
10 if ( direction === "landscape-primary" || direction === "landscape-secondary" ) {
11 $( "#go_textbox_popup a" ).attr( "href", "#textbox_popup_landscape" );
16 function onSuccessPopupCallback ( ori ) {
17 if ( ori.status === "PORTRAIT_PRIMARY" || ori.status === "PORTRAIT_SECONDARY" ) {
18 if( $( "#textbox_popup_landscape" ).parents( ".ui-popup-container" ).is( ".ui-popup-active" ) ) {
19 $( "#textbox_popup_landscape" ).popup( "close" );
21 $( "#go_textbox_popup a" ).attr( "href", "#textbox_popup" );
23 else if ( ori.status === "LANDSCAPE_PRIMARY" || ori.status === "LANDSCAPE_SECONDARY" ) {
24 if( $( "#textbox_popup" ).parents( ".ui-popup-container" ).is( ".ui-popup-active" ) ) {
25 $( "#textbox_popup" ).popup( "close" );
27 $( "#go_textbox_popup a" ).attr( "href", "#textbox_popup_landscape" );
31 function onErrorPopupCallback ( error ) {
32 console.error( "An error occurred " + error.message );
35 if ( $.tizen.__tizen__.util.isMobileBrowser() ) {
36 tizen.systeminfo.addPropertyValueChangeListener( "DEVICE_ORIENTATION", onSuccessPopupCallback, onErrorPopupCallback );