Closed (works as designed)
Project:
DHTML Menu
Version:
6.x-3.x-dev
Component:
Graceful degradation
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 May 2009 at 21:10 UTC
Updated:
30 Sep 2019 at 13:56 UTC
Jump to comment: Most recent
Comments
Comment #1
neochief commentedByt the way, it works fine for me, you may check at http://sourcemaking.com/refactoring
Comment #2
cburschkaI'm sorry, but inline script tags and document.write() are both unacceptable use of Javascript in Drupal. Any approach would need to work via extending the Drupal.behaviors object and using jQuery.
However, even if there were a solution using proper Javascript, this isn't justified. The module already uses a static class and CSS to ensure that collapsed links are not displayed, even if the user isn't using Javascript. This is done by applying the
start-collapsedclass to closed menus, which are hidden with thedisplay:nonerule that is respected by all search crawlers. And writing these elements via Javascript would risk a substantial cost in performance.Comment #3
neochief commentedThanks for your reply, Arancaytar.
However, I don't agree about search crawlers and
display:none;. For example, we have a Yandex.ru search engine with 60% part on search market in post USSR countries. It definatelly doesn't respects invisible content like Google does.I can write additional code, which will make this way of outputing as an option (disabled by default), but it's really critical just to have it.
As for the way this code renders the menu — yes, I know that usually things should be made through the JS behaviors, but I don't see any reason why we should move this code to behaviors, as it will only make everything slower without any benefit. Please, correct me if I wrong.
Comment #4
vuil