iVis-at-Bilkent / cytoscape.js-context-menus

A Cytoscape.js extension to provide context menu around elements and core instance
MIT License
86 stars 41 forks source link

Disable tooltips #2

Closed ugurdogrusoz closed 7 years ago

ugurdogrusoz commented 8 years ago

Tooltips might be used to provide help on the menu items but the users might prefer to disable them. Maybe an option to disable them if not needed?

metincansiper commented 7 years ago

@ugurdogrusoz the I considered the suggestion in #8 it works to disable tooltips, but then I realized that you want this to be optional and I reverted that change for now.

I think that instead of an option to disable tooltips globally or per menu item we may have an option called 'tooltip' or 'title' (Currently 'title' is the option name we use to set the content of each menu item I think that is misleading and we need to change the name of this option as 'content' because in html/css context 'title' sets the tooltip rather then content. However, changing it may require a major release.) and if this option is set it will determine the tooltip of the menu item, if it is not set then the menu item will not have a tooltip. In this way users will be able to set titles fof menu items other then their content.

If you accept it I can do in this way.

metincansiper commented 7 years ago

I make the changes that I mentioned in the previous comment. I named the option, previously named as "title", as "content". I added "tooltipText" option which determines the tooltip text of a menu item. If it is not set for a menu item then that menu item does not have a tooltip. After making these changes I relased v3.0.0