[dokuwiki] Re: Making index__tree open&close icons clickable links

  • From: Christopher Smith <chris@xxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Thu, 12 Jul 2012 12:26:08 +0100

On 11 Jul 2012, at 09:55, Michael Bazzinotti wrote:

> The Goal: Have the open&close icons in the index__tree (sidebar) as clickable 
> links that operate the same as clicking the text-links.
> 
> here's a visual of what i am talking about:
> http://s17.postimage.org/gjt3egjsv/Screen_shot_2012_07_11_at_4_07_40_AM.png
> 
> 

In strict html there are rules for element nesting.  e.g.
- An <li> should be a child of an list container, <ol> or <ul>
- An <a> shouldn't enclose block level elements.

You're restructuring breaks that which could have consequences elsewhere, 
either in browsers or in the templates css and js which may be based on the 
original structure - which you seem to have discovered.

***
You might find it easier to rework the css to move the open/close icons from 
<li> elements to the anchor links.

Something along the lines of 
/* html added to increase specificity of the selector above the existing 
selector */
html .dokuwiki ul.idx li.open,
html .dokuwiki ul.idx li.open {
 list-style: none; 
}
.dokuwiki ul.idx li.open > .li > a.idx_dir {
  background: url("/lib/tpl/dokuwiki/images/open.png") 0 50% no-repeat;
  margin-left: -1.5em;
  padding-left: 1.5em;
}
.dokuwiki ul.idx li.open > .li > a.idx_dir {
  background: url("/lib/tpl/dokuwiki/images/closed.png") 0 50% no-repeat;
  margin-left: -1.5em;
  padding-left: 1.5em;
}



- Chris--
DokuWiki mailing list - more info at
http://www.dokuwiki.org/mailinglist

Other related posts: