[Xerte-dev] Re: menu.rlm

Julian Tenney Julian.Tenney at nottingham.ac.uk
Mon Feb 13 13:08:58 GMT 2012


Those changes should merge in fine to anything Jonathan is doing: give it a whirl.

From: xerte-dev-bounces at lists.nottingham.ac.uk [mailto:xerte-dev-bounces at lists.nottingham.ac.uk] On Behalf Of Ron Mitchell
Sent: 13 February 2012 12:31
To: 'For Xerte technical developers'
Subject: [Xerte-dev] menu.rlm

Hi all
I'd previously seen someone creating an LO using one of the menu options rather than linear and the buttons were overlapping when the number of items required 2 columns. At the time I'd put that down to them having long page titles but I've been working on an LO requiring at least two columns myself and it seems there is/was an error in the code. In the makeMenu script it has/had...

//get menuItem width
if (numItems < 13){
  itemWidth = 350;
} else if (numItems < 26){
  itemWidth = 300;
} else {
  itemWidth = 245;
}

With more than 16 items the 1st and second column buttons overlap regardless of page title size.
I've changed this as follows and tested with 2 columns and 3 columns:

if (numItems < 17){
  itemWidth = 350;
} else if (numItems > 16 & numItems < 33){
  itemWidth = 240;
} else if (numItems > 32){
  itemWidth = 240;
}

Actually as you'll see the size of the button doesn't need to change between 2 columns and 3 columns but I left the 3 options in just in case there might be a future reason to change for 3 columns.

I could commit this but just wondering how any changes now get reflected in the changes Jonathan is making?

HTH
Ron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nottingham.ac.uk/pipermail/xerte-dev/attachments/20120213/0ef281f8/attachment.html>


More information about the Xerte-dev mailing list