[MAGNOLIA-2876] Context menu icons in tree only support GIFs - at least after javascript condition once has deactivated the menu item Created: 27/Sep/09  Updated: 23/Jan/13  Resolved: 19/Feb/10

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: 4.1.1
Fix Version/s: 4.3

Type: Bug Priority: Major
Reporter: Will Scheidegger Assignee: Magnolia International
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File context-menu-any-extension-icons.patch    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

In the tree configuration, one can define icons to be displayed with context menu items (ContextMenuItem.setIcon()). If you provide the path to a PNG file (say "/.resources/icons/16/my_icon.png"), the following will happen:

  • First, the icon is displayed with the menu item.
  • Once the menu item is deactivated by a javascript condition, it tries to display a file called "my_icon_inactive.gif", a GIF, not a PNG
  • Now when the menu item is activated again, the active icon is gone too, because the menu tries to display "my_icon.gif" now, also a GIF
    So the JS handling the icon does not look at the file extensions. The context menu icons therefore only really work with GIFs.


 Comments   
Comment by Diego Schivo [ 19/Feb/10 ]

I had the same problem and fixed it by editing contextmenu.js in the admininterface module.
See attachment: context-menu-any-extension-icons.patch

Comment by Magnolia International [ 19/Feb/10 ]

Thanks for the patch ! Applied on trunk (4.3) as well as 4.1 and 4.2 branches.

Generated at Mon Feb 12 03:40:59 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.