Skip to content

Instantly share code, notes, and snippets.

@miketaylr
Created January 12, 2016 15:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miketaylr/1c4502ff78eebddae0e9 to your computer and use it in GitHub Desktop.
Save miketaylr/1c4502ff78eebddae0e9 to your computer and use it in GitHub Desktop.
U.onResize = function() {
U.handleNexusOrientation();
U.handleiOS6PositionTablet();
U.handleBB10FixedPosition();
if (U.isOAAMLoginWifiPage(U.getCurrentPage())) {
var x = 0;
if (U.isTablet()) {
x = 42
} else {
x = 28
}
$("#login-wrapper").height($(window).height() - x)
}
if (RTModernizr.ios7ThinClient()) {
var baseString = "width=device-width, maximum-scale=1.0, minimum-scale=1.0, initial-scale=1.0, user-scalable=no";
$("#metaviewport").attr("content", "");
$("#metaviewport").attr("content", baseString + ", height=" + $(window).height() + "px")
}
U.handleiOS6Popup();
if (U.getOrientation() == 1) {
if (U.getCurrentPage() == "home" || U.getCurrentPage() == null) {
if (U.isTablet()) {
U.setLayout(4)
} else {
if (!!Modernizr.blackberry) {
U.setLayout(1);
$("#pillarContainer").css("display", "table");
$("#contentArea").css("margin-top", "55px")
} else {
if (!!Modernizr.BB10 && ($(window).width() == 346 || clientParams.device_name == "classic")) {
U.setLayout(1);
$("#pillarContainer").css("display", "table");
$("#contentArea").css("margin-top", "85px")
} else {
U.setLayout(3)
}
}
}
} else {
if (U.isTablet()) {
U.setLayout(5)
} else {
if (!!Modernizr.blackberry) {
U.setLayout(2);
$("#contentArea").css("padding-top", "0px")
} else {
U.setLayout(2)
}
}
}
} else {
if (!!Modernizr.MSIE10) {
$("#pillarArea").css("position", "static");
$("#pillarArea").css("top", "auto")
}
if (U.getCurrentPage() == "home" || U.getCurrentPage() == null) {
U.setLayout(1)
} else {
U.setLayout(2)
}
}
if ($("#exitSplash")) {
$("#exitSplash > div").height($(window).height())
}
}
@rafaelrinaldi
Copy link

The way the data flows is easy to reason about.

@digitalicarus
Copy link

if (U.canHandleNexusOrientation()) {
  U.isOnATablet();
  soDo();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment