Detecting Rich Display

Use this board to ask questions or have discussions with other Genie users.
Post Reply
pjshuey
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

Post by pjshuey »

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.
Scott Klement
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

Post by Scott Klement »

Would pui.getDisplayType() work for you? Here's the docs:
http://www.profoundlogic.com/docs/pages ... d=25854266
pjshuey
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

Post by pjshuey »

Yes! That should do it! I search and searched for a command and did not see that one. Sorry for wasting your time!
pjshuey
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

Post by pjshuey »

Is there any way to prevent the genie.js from setting the position of the insideDiv to "relative" if the display type is 'rdf'?
Scott Klement
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

Post by Scott Klement »

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:

Code: Select all

pui.runtimeContainer.style.position = "absolute";
It's hard (for me, anyway) to visualize everything that might affect, but you could try it and see.
pjshuey
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

Post by pjshuey »

I did do that but control goes back to genie.js before the screen is actually rendered and it sets it back to relative.
User avatar
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

Post by matt.denninghoff »

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:

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);
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:

Code: Select all

  pui.genie.setContainerWidth = false;
  pui.runtimeContainer.style.width = "100%";
pjshuey
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

Post by pjshuey »

Thank you! I had to go with the first option, but it works beautifully!
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 0 guests