MydfProHTML - hack to autocollapse previous info row

Talk to other Pedia users about the programs, share tricks and tips or ask questions about existing features.
Post Reply
lajcik
Junior Member
Junior Member
Posts: 3
Joined: Sat Oct 23, 2010 12:48 pm

MydfProHTML - hack to autocollapse previous info row

Post by lajcik »

Hi,

I was going to post a feature request but when I saw how easy it is to modify export templates i just gone and did what i wanted :)

I was really annoyed that when you open one box the other doesn't collapse by default which can quickly get messy. Here's a quick modification to automatically collapse the previous details.

Since the forum has attachments disabled I'll just post the code:

Replace the images/js.js in the template :)

Code: Select all

/* Hidden */
var opened = undefined;

function view(x) {
  var targetId, targetElement;
  targetId = x;

  if (document.getElementById){
	     targetElement = document.getElementById(targetId);
  }else if(document.all){
  	 targetElement = document.all[targetId];
  }else if(document.layers){
  	targetElement = document[targetId];
  }

   if (targetElement.style.display == "none") {
		if(opened != undefined) {
			opened.style.display = "none";
		}
        targetElement.style.display = "block";
		opened = targetElement;
	} else {
        targetElement.style.display = "none";
		opened = undefined;
    }
}
User avatar
Conor
Top Dog
Posts: 5345
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: MydfProHTML - hack to autocollapse previous info row

Post by Conor »

Thank you for sharing your improvement, I am positive others will find it useful. I can see a use for both behaviors so I will leave the shipping template as is.
Post Reply