Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EB21117DE0 for ; Tue, 15 Sep 2015 21:02:47 +0000 (UTC) Received: (qmail 75999 invoked by uid 500); 15 Sep 2015 21:02:46 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 75938 invoked by uid 500); 15 Sep 2015 21:02:46 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 75810 invoked by uid 99); 15 Sep 2015 21:02:46 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Sep 2015 21:02:46 +0000 Date: Tue, 15 Sep 2015 21:02:46 +0000 (UTC) From: "Christopher Mindus (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CB-9664) "backbutton" event not fired for Windows Phone, app exits ["backclick" on WinJS.Application... as workaround] MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-9664?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Christopher Mindus updated CB-9664: ----------------------------------- Environment: Windows platform windows@4.1.0 (was: Windows) > "backbutton" event not fired for Windows Phone, app exits ["backclick" on WinJS.Application... as workaround] > ------------------------------------------------------------------------------------------------------------- > > Key: CB-9664 > URL: https://issues.apache.org/jira/browse/CB-9664 > Project: Apache Cordova > Issue Type: Bug > Components: Windows > Affects Versions: 5.3.2 > Environment: Windows platform windows@4.1.0 > Reporter: Christopher Mindus > > The "backbutton" event is not fired for Windows, the app exits instead. > Reproduce as follows: > 1. Run the commands: > cordova create test > cd test > cordova platform add windows > 2. Edit www/js/index.js and insert the following lines after "app.receivedEvent('deviceready');": > document.addEventListener('backbutton',function(e) { > alert('Back button'); > }, false); > if (window.WinJS && window.WinJS.Application) { > window.alert = navigator.notification.alert; > WinJS.Application.addEventListener("backclick", function (e) { > alert('Back button from *WinJS*'); > // Prevent the default behavior by returning true. e.preventDefault() doesn't cancel the external code. > return true; > }); > } > 3. Run command: > cordova build windows > 4. Open Visual Studio 2015 with platforms\windows\CordovaApp.sln, select "CordovaApp.Phone (Windows Phone 8.1)" as "Startup Project". Run the "Emulator 8.1 WVGA" to test. > 5. Press Back button on emulator device. The message "Back button from *WinJS*" will be shown and not "Back button". > The additional lines to add "backclick" event using WinJS.Application is a workaround that I found to work as a replacement. If those lines are removed, the app will effectively exit when the Back button is pressed. It works just fine with e.g. Android (test with "cordova platform add android" and "cordova run android") to verify. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org