Hi, I tried the simple example found in documentation and it doesn't work!
Here's the code:
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width,user-scalable=no"/> <title>Wearable UI</title> <link rel="stylesheet" href="lib/tau/themes/default/tau.min.css"> <!-- load theme file for your application --> <link rel="stylesheet" href="css/style.css"> </head> <body> <div class="ui-page ui-page-active" id="main"> <header class="ui-header"> <h2 class="ui-title">Wearable UI</h2> </header> <div class="ui-content content-padding"> <button id="button" class="ui-btn" onclick="openP();">Open</button> </div> </div> <div id="confirmPopup" class="ui-popup"> <div class="ui-popup-header">Delete</div> <div class="ui-popup-content">Delete the selected item?</div> <div class="ui-popup-footer ui-grid-col-2"> <button id="2btnPopup-cancel" class="ui-btn">Cancel</button> <button id="2btnPopup-ok" class="ui-btn">OK</button> </div> </div> </body> <script type="text/javascript" src="lib/tau/js/tau.min.js"></script> <!-- load javascript file for your application --> <script src="js/app.js"></script> <script src="js/lowBatteryCheck.js"></script> </html>
and JS:
( function () { window.addEventListener( 'tizenhwkey', function( ev ) { if( ev.keyName == "back" ) { var page = document.getElementsByClassName( 'ui-page-active' )[0], pageid = page ? page.id : ""; if( pageid === "main" ) { tizen.application.getCurrentApplication().exit(); } else { window.history.back(); } } } ); } () ); function openP() { tau.openPopup("#confirmPopup"); }
absolutely simple ... but when I click the button nothing happens ...