Skip to content

Instantly share code, notes, and snippets.

@sudikrt
Created June 2, 2020 07:04
Show Gist options
  • Save sudikrt/60905f076a1b3277bb0bd01ffa41f4a5 to your computer and use it in GitHub Desktop.
Save sudikrt/60905f076a1b3277bb0bd01ffa41f4a5 to your computer and use it in GitHub Desktop.
if ($A.get("$Browser.formFactor") === 'PHONE') {
$A.createComponent(
"aura:html",
{
"aura:id": "styleTag",
"tag": "style",
"body": '.overLayCustomStyles {overflow : scroll; height:' + ($(window).height() - 173) + 'px;}'
},
function(newHtml, status, errorMessage){
//Add the new button to the body array
if (status === "SUCCESS") {
var body = cmp.get("v.body");
body.push(newHtml);
cmp.set("v.body", body);
}
else if (status === "INCOMPLETE") {
console.log("No response from server or client is offline.")
// Show offline error
}
else if (status === "ERROR") {
console.log("Error: " + errorMessage);
// Show error message
}
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment