Skip to content

PKUI.CORE.updateOrientation

kerrishotts edited this page Nov 14, 2012 · 1 revision

(part of PKUI.CORE)

Return Type: void

Parameters: none

Called whenever the device's orientation changes, or upon app initialization via PKUI.CORE.initializeApplication.

The name is somewhat a misnomer -- though it's primary function is to update the orientation class that sits on the body tag, it also makes sure several other classes are in place.

The function makes sure the following is attached to the body tag:

  • Device platform (such as ios or android)
  • Form Factor (such as phone or tablet)
  • Current Scale ( hiDPI, loDPI; only detects retina displays currently )
  • Current Orientation (portrait, landscape)
  • v2.0 Device (such as ipad, iphone, droid-tablet, droid-phone)

Notes

This method can be called directly, though it rarely ever needs to be. The only time it is called directly instead of via an orientationchange event is at application initialization.

An example of what the body tag might look like:

<body class="iOS phone portrait hiDPI iPhone">

Version

0.1 Introduced

0.2 Device added; Docs Valid

Clone this wiki locally