Detecting Rich Display
-
- Experienced User
- Posts: 119
- Joined: Wed May 25, 2016 11:58 am
- First Name: Patti
- Last Name: Shuey
- Company Name: Conestoga Wood Specialties
- Phone: 7174452886
- Address 1: 645 Reading Road
- City: East Earl
- State / Province: Pennsylvania
- Zip / Postal Code: 17519
- Country: United States
- Contact:
Detecting Rich Display
Is there an easy way to detect in genie when the program being called is a rich display without modifying the program? Maybe something that can be added to the custom.js for the genie skin???? I want to position the div's differently if it is a rich display.
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: Detecting Rich Display
Would pui.getDisplayType() work for you? Here's the docs:
http://www.profoundlogic.com/docs/pages ... d=25854266
http://www.profoundlogic.com/docs/pages ... d=25854266
-
- Experienced User
- Posts: 119
- Joined: Wed May 25, 2016 11:58 am
- First Name: Patti
- Last Name: Shuey
- Company Name: Conestoga Wood Specialties
- Phone: 7174452886
- Address 1: 645 Reading Road
- City: East Earl
- State / Province: Pennsylvania
- Zip / Postal Code: 17519
- Country: United States
- Contact:
Re: Detecting Rich Display
Yes! That should do it! I search and searched for a command and did not see that one. Sorry for wasting your time!
-
- Experienced User
- Posts: 119
- Joined: Wed May 25, 2016 11:58 am
- First Name: Patti
- Last Name: Shuey
- Company Name: Conestoga Wood Specialties
- Phone: 7174452886
- Address 1: 645 Reading Road
- City: East Earl
- State / Province: Pennsylvania
- Zip / Postal Code: 17519
- Country: United States
- Contact:
Re: Detecting Rich Display
Is there any way to prevent the genie.js from setting the position of the insideDiv to "relative" if the display type is 'rdf'?
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: Detecting Rich Display
Not that I'm aware of -- I believe it always sets the div with id="5250" to relative positioning.
You could set it to a different positioning style yourself if you wanted with code like this:
It's hard (for me, anyway) to visualize everything that might affect, but you could try it and see.
You could set it to a different positioning style yourself if you wanted with code like this:
Code: Select all
pui.runtimeContainer.style.position = "absolute";
-
- Experienced User
- Posts: 119
- Joined: Wed May 25, 2016 11:58 am
- First Name: Patti
- Last Name: Shuey
- Company Name: Conestoga Wood Specialties
- Phone: 7174452886
- Address 1: 645 Reading Road
- City: East Earl
- State / Province: Pennsylvania
- Zip / Postal Code: 17519
- Country: United States
- Contact:
Re: Detecting Rich Display
I did do that but control goes back to genie.js before the screen is actually rendered and it sets it back to relative.
- matt.denninghoff
- Profound Logic Staff Member
- Posts: 115
- Joined: Wed Feb 10, 2016 3:53 pm
- First Name: Matthew
- Last Name: Denninghoff
- Company Name: Profound Logic Software
- State / Province: Ohio
- Country: United States
- Contact:
Re: Detecting Rich Display
In the genie rendering code, setting the runtimeContainer's style.position to "relative" is one of the last things that happens--after all "onload" and other customize-able events.
If there is no other way to accomplish what you're trying to do, it is possible to use the JavaScript setTimeout function to make your code run after the rendering code's call stack finishes.
For example:
However, when using setTimeout, sometimes timing of code can get complicated and difficult to debug. You might have more luck doing something like this in a pui.onload function defined inside your Genie skin's custom.js file:
If there is no other way to accomplish what you're trying to do, it is possible to use the JavaScript setTimeout function to make your code run after the rendering code's call stack finishes.
For example:
Code: Select all
// Queues this function in the JavaScript "message" queue.
setTimeout(function(){
console.log("timeout, set style position.");
pui.runtimeContainer.style.position = "absolute";
},0);
Code: Select all
pui.genie.setContainerWidth = false;
pui.runtimeContainer.style.width = "100%";
-
- Experienced User
- Posts: 119
- Joined: Wed May 25, 2016 11:58 am
- First Name: Patti
- Last Name: Shuey
- Company Name: Conestoga Wood Specialties
- Phone: 7174452886
- Address 1: 645 Reading Road
- City: East Earl
- State / Province: Pennsylvania
- Zip / Postal Code: 17519
- Country: United States
- Contact:
Re: Detecting Rich Display
Thank you! I had to go with the first option, but it works beautifully!
Who is online
Users browsing this forum: No registered users and 3 guests