TizenWinset : remove landscape SIP on mode
[platform/framework/web/web-ui-fw.git] / demos / tizen-winsets / webappOrientation.js
1 function onSuccessCallback ( ori ) {
2         console.log( ori.status );
3         if ( ori.status === "PORTRAIT_PRIMARY" ) {
4                 window.screen.lockOrientation( "portrait-primary" );
5         }
6         else if ( ori.status === "PORTRAIT_SECONDARY" ) {
7                 window.screen.lockOrientation( "portrait-secondary" );
8         }
9         else if ( ori.status === "LANDSCAPE_PRIMARY" ) {
10                 window.screen.lockOrientation( "landscape-primary" );
11         }
12         else if ( ori.status === "LANDSCAPE_SECONDARY" ) {
13                 window.screen.lockOrientation( "landscape-secondary" );
14         }
15 }
16 function onErrorCallback ( error ) {
17         console.log( "An error occurred " + error.message );
18 }
19
20 try {
21         if ( $.tizen.__tizen__.util.isMobileBrowser() ) {
22                 tizen.systeminfo.addPropertyValueChangeListener( "DEVICE_ORIENTATION", onSuccessCallback, onErrorCallback );
23         }
24 } catch ( exc ) {
25         alert( exc.message );
26 }
27