Comments (10)
Are you talking about this? If so, go ahead and integrate it, I'd be happy to merge…
from jquery-contextmenu.
Wow, fast response. Yes, exactly this. :-) I will try to integrate theming later. I plan to use your menu for JSF component(s) in PrimeFaces Extensions project http://code.google.com/p/primefaces-extensions/
Thanks.
from jquery-contextmenu.
Should we always use themable menu then or per configuration "theming"=true/false?
from jquery-contextmenu.
If the current "style" (cough) can be converted to that UI-themening structure, go ahead. The basic idea would be to enable this widget to run without jQueryUI, though. So whatever you do, make sure it works without any additional components (like jQueryUI). But if they're present, their functionality (in this case that themeroller thingie) may be used.
In short: try to convert it to the theme thing, but make it work without jQuery UI being available.
from jquery-contextmenu.
Understood. Thanks. Nice dynamic menu by the way. This is what I need - build a dynamic menu without Ajax requests, on the client-side only. Look-&-feel should be better though.
from jquery-contextmenu.
I have themeroller-ized contextMenu at least for my limited purposes.
Other people may need to use more/other themeroller classes, I stopped looking when it started working for me.
Here is how I did it:
- Removed settings for border: font-family: font-size: background: and background-color: from classes in jquery.contextMenu.css so as to remove conflicts with themeroller settings.
- Added the "ui-widget" themeroller class to the top contextMenu ul, i.e. $.contextMenu({"className":"ui-widget"});
- Added the "ui-widget-content" themeroller class to all the contextMenu ul's with the following run-time code:
$(function(){
$("selector").contextMenu({x: -1000, y: -1000}); //force menu instantiation
$(".context-menu-list:not(.ui-widget-content)").addClass("ui-widget-content"); //add the class
$("selector").contextMenu("hide"); //hide menu
}); - Added themeroller hover classes with the following run-time code:
$(function(){
$(document.body).on("contextmenu:focus", ".context-menu-item", function(e){ $ (this).addClass("ui-state-hover"); })
$(document.body).on("contextmenu:blur", ".context-menu-item", function(e){ $ (this).removeClass("ui-state-hover"); })
});
I believe that this most excellent plugin could be made themeroller friendly with the following adjustments:
- Move conflicting CSS settings to a separate contextMenu .css file so that implementers could avoid conflicting settings without modifying the standard CSS by not linking the additional .css file.
- Provide a separate classname option for submenus (i.e. "classNameSub"). This would eliminate the code in step 3. In my case both "className" and "classNameSub" would be set to "ui-widget-content" but that may not be true for everyone.
- Provide classname options for menu item hover and blur. This would eliminate the code in step 4.
Implementers would still need to figure what themeroller classes they would need (which is not trivial) but contextMenu would accommodate their needs.
from jquery-contextmenu.
Creating a Custom Theme in jQuery might help
from jquery-contextmenu.
jQuery UI Theming and jQuery UI Theming API might help on this front.
from jquery-contextmenu.
Here's an incomplete draft that highlights issues on both sides: http://jsbin.com/ojuqix/1/edit
Specifically:
- I had to copy the styles for the ".ui-menu .ui-menu-item a" selector and changed the "a" to "span" to match the markup here. This wouldn't be necessary if you change contextmenu to use "a" in place of "span", or if jQuery UI improves the styles for menu to not require a specific child element. Since 1.10 drops IE6 support, we might as well use a child selector...
- There's no way to customize the active/focus/hover class, so I just added "ui-state-focus" to the first menu item to show what it would look like
Other then that its just a matter of adding the right classes to the root element and each item and their child.
from jquery-contextmenu.
I've started playing with this in the jqueryui-theme branch. I've noted some issues and questions in demo/jquery-ui-theme.html, in case anybody wants to have a crack at it
from jquery-contextmenu.
Related Issues (20)
- How can i rebind the event and overwrite items callback ? HOT 1
- Disable Icons HOT 2
- Allow the selector receive an Element or JQueryNode
- Context menu jumps to the top of the screen HOT 1
- Display bug for a long list of submenu
- Seeking an official way to change context menu items style
- bug?: defining left click as trigger type triggers "oncontextmenu" of trigger button HOT 1
- get the element where the context menu was shown on right click HOT 2
- Issue with menu that is taller than the viewport with submenu items HOT 1
- Chrome v96.0.4664.45 HOT 1
- Do beta (v3) docs exist? The 'v3 Documentation' link goes to v2 Docs currently.
- Can't get Font Awesome icons working HOT 5
- use custom svg icons by gulp HOT 1
- Is it possible to hide a separator? HOT 1
- Animations do not work.
- Security - CVE-2021-41184: Upgrade embedded jQuery UI Position to 1.13+ (v2.x)
- Left click picking up parent as well as targeted child div HOT 1
- Context Menu Titles
- Append to an existing contextMenu?
- Jquery-contextMenu does not trigger the event on the new target element
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery-contextmenu.