I have an ajax-enabled form built using FAPI. One button refreshes part of the form via ajax. If you want an example of this implementation, you can refer to the Poll module because most of my form's functionality comes from that module.
Anyway, I noticed that when an ajax call is made, the folder icon in dhtml menu keeps replicating itself, so that, where there was one icon, there would be two. If another ajax call is made, then there would be three icons now. Here's how it was after three calls:
![]()
I didn't notice this issue with ajax-enabled "Views" though.
So, I just found the line in the dhtml_menu.js file which blindly added the extra anchor tags for the bullet icon and I added an "if" condition there.
Add the following piece of code at line 109:
if(link.children().hasClass("dhtml-menu-icon")){
/**Added condition to prevent adding multiple icons upon ajax calls.**/
return false;
}I am not familiar with creation of patch files. I've attempted to do so in netbeans and attached it here.
| Comment | File | Size | Author |
|---|---|---|---|
| dhtml_menu_js.patch | 456 bytes | Anandkumar |
Comments
Comment #1
zylootino commentedThe fix worked for me. Thanks