Github user agrieve commented on a diff in the pull request:
https://github.com/apache/cordova-lib/pull/128#discussion_r22227969
--- Diff: cordova-lib/src/configparser/ConfigParser.js ---
@@ -219,6 +258,47 @@ ConfigParser.prototype = {
},
/**
+ * Finds the value of the orientation <preference>.
+ *
+ * @param {String} [platform] Platform name
+ * @return {String} Global/platform-specific orientation
(or undefined if both are undefined)
+ */
+ getOrientation: function (platform) {
+
+ var globalOrientation = this.getGlobalPreference('orientation');
+ var platformOrientation = null;
+ var platformSupportedOrientations = null;
+
+ // Check if the value of the global orientation preference is
invalid
+ if (globalOrientation &&
!_.contains(PREFERENCE_ORIENTATION_VALUES, globalOrientation)) {
+ events.emit( 'warn', [ 'Unknown value for global orientation
preference:', globalOrientation ].join(' ') );
+ globalOrientation = undefined;
+ }
+
+ if (!platform) {
+ return globalOrientation;
+ }
+
+ platformSupportedOrientations =
supportedPreferences.orientation[platform];
+
+ if (!platformSupportedOrientations) {
+ throw new CordovaError([ 'No supported orientations defined
for platform', platform ].join (' '));
+ }
+
+ platformOrientation = this.getPlatformPreference('orientation',
platform);
+
+ // Check if the value of the platform-specific orientation
preference is invalid
+ if (platformOrientation &&
!_.contains(platformSupportedOrientations, platformOrientation)) {
--- End diff --
Would this mean that "portrait" is not a valid value for this preference on
iOS? I think we'd want to check that it's in platformSupportedOrientations *or*
PREFERENCE_ORIENTATION_VALUES
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]