Return-Path: X-Original-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4A5289F93 for ; Fri, 11 May 2012 19:33:12 +0000 (UTC) Received: (qmail 60199 invoked by uid 500); 11 May 2012 19:33:12 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 60175 invoked by uid 500); 11 May 2012 19:33:12 -0000 Mailing-List: contact callback-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-dev@incubator.apache.org Received: (qmail 60165 invoked by uid 99); 11 May 2012 19:33:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 May 2012 19:33:12 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 May 2012 19:33:09 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 3641E491BB6 for ; Fri, 11 May 2012 19:32:48 +0000 (UTC) Date: Fri, 11 May 2012 19:32:48 +0000 (UTC) From: "Jesse MacFadyen (JIRA)" To: callback-dev@incubator.apache.org Message-ID: <1074987274.55825.1336764768223.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <201771535.52774.1336699429453.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (CB-751) Undefined function is called when orientation change 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-751?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13273535#comment-13273535 ] Jesse MacFadyen commented on CB-751: ------------------------------------ It makes sense that different views within an application may want to limit their supported orientations, so this was an opportunity to give the webview a chance to decide if it should rotate. This functionality is available on the native side for all devices, so to me it makes sense to support it in cordova. However, until it is supported on all platforms, or documented as a non-existent quirk, it is a defect. Setting supported orientations in the plist in an iOS project is a one time thing, IMHO the plist should always support all orientations and the developer's code should be able to choose whether it wants to rotate based on it's current state. The previous mailing list discussion de-volved into building a vast API for the webview code to specify it's available orientations at any given time, however it is not possible to force an orientation change based on the call to set the available orientations to something different than the current orientation. The error above can be safely ignored, it is Obj-C calling a method it expects to be defined on the window. 'shouldRotateToOrientation' If you do not want to see the error message, because it bugs you, simply add : window.shouldRotateToOrientation = function(newOrientation){return true;}; Alternatively, we could change the Obj-C side to be : NSString* jsCall = [ NSString stringWithFormat:@"(function(){if('shouldRotateToOrientation' in window) return window.shouldRotateToOrientation(%d);})();",i]; Then at least no one would see errors output .. > Undefined function is called when orientation change > ---------------------------------------------------- > > Key: CB-751 > URL: https://issues.apache.org/jira/browse/CB-751 > Project: Apache Cordova > Issue Type: Bug > Components: iOS > Affects Versions: 1.6.0, 1.6.1, 1.7.0 > Environment: ipod, ios 5.1 > Reporter: Clement Vollet > Assignee: Shazron Abdullah > Fix For: 1.8.0 > > > I get an undefined exception when changing the orientation of the device. > Steps to "recreate": > in a new project, add the following in index.html: > function onDeviceReady() > { > // do your thing! > navigator.notification.alert("Cordova is working") > window.onerror=function(error_msg, URL, line_number) { > console.log("WINDOW > Message: " + error_msg); > console.log("WINDOW > URL: " + URL); > console.log("WINDOW > Line: " + line_number); > } > } > And then in the simulator, rotate the screen. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira