You are not logged in.

Announcement

Forum database was corrupt and an old backup was restored as temporary replacement. Registrations closed until the database is recovered. Please ask questions using the Contact form

#1 28-09-2013 14:14:24

chrismaliszewski
Contributors
From: Torun, Poland
Registered: 06-05-2013
Posts: 246
Website

Bug with accordion in page and sidepanel at the same time

With reference to this bug. I changed topic name of previous one because still there is one bug even after resolving it.

It occures it newest version of Metro UI template.

Bug: wrong work of accordion plugin when accordions are both in sidepanel and page and user tries to open sidepanel.

Appearing of bug: each time user opens sidepanel, new arrow of accordions on page is created.

Who to see bug?
Either go to my website and click red tile or...
to see bug in clean V4b2 do these changes (fastes way):
-config/sidebar, change "some_info" sidebar and in any tile of it change "url"=> value to "external:panels/example.php",
-in pages/sidebars.php change content of file at the bottom that it will contain "accordions", i.e.

<div class="metro-accordion">
<h3>This page will have a sidebar on the left.</h3>
<div><p>Did you know we can have a sidebar in a sidepanel? Click <a href="panels/example.php">here</a> to see the example.
<p>By the way, you can link to any metro page using the method like this (check source): <a <?php metroLink("welcome.php")?>>Link to welcome page</a>.
<p>If you prefer to open it in a new tab, you can do that this way: <a <?php metroLink("newtab:welcome.php")?>>Link to new tab</a>.
<p>Easy, isn't it?
</div>

,
-go to page #!/sidebars and click tile that goes to sidepanel.

Any idea how to have accordions on both pages?

Last edited by chrismaliszewski (28-09-2013 14:25:37)

Offline

#2 28-09-2013 14:43:00

chrismaliszewski
Contributors
From: Torun, Poland
Registered: 06-05-2013
Posts: 246
Website

Re: Bug with accordion in page and sidepanel at the same time

Fast repair changes (important - clear cache!):
plugins/accordion/plugin.js
-change 1st line to

createAccordions = function(name){

, name will be name of accordion we want to be created, if it isn't set we will use default value of name (see below),
-change all "div.metro-accordion" (with "" signs) string to string name,
-add those lines of code below 1st line:

if(name===undefined)name = "div.metro-accordion";
	else name="div.metro-accordion-"+name;

, so.. if name is not set we will use solution from previous versions, else we need to set class name of accordion to metro-accordion-NAME.

How to work with it: if you want to create accordion in panel site (i.e. example.php from clean V4b2) set class name of div with accordions like this:

<div class="metro-accordion metro-accordion-NAME">

and on the end of file call function

createAccordions('NAME');

.
Why to use 'metro-accordion' string twice? Because of CSS styles.

Any other idea, maybe nicer, to solve this problem? smile

PS. Thomas, if there will be no other propositions of solution it should be included in next update smile.

Last edited by chrismaliszewski (28-09-2013 15:18:02)

Offline

Board footer

Powered by FluxBB