Comments (6)
My icon solution for Bootstrap 5 and Bootstrap Icons (after text for submenu):
/* any menu item that has a submenu */
.ctxmenu li.submenu::after{
content:'\bi-caret-right';
position:absolute;
display:block;
top:0;
right:0.3em;
font-family:bootstrap-icons;
line-height:22px;
}
And the first icon before the text (line 134 is li.innerHTML = item.text;
):
text: '<span class="bi-box-arrow-in-right">My text...</span>',
See:
https://github.com/musicman3/eMarket/blob/bootstrap-5/ext/ctxmenu/ctxmenu.js
https://github.com/musicman3/eMarket/blob/bootstrap-5/ext/ctxmenu/ctxmenu.css
https://github.com/musicman3/eMarket/blob/bootstrap-5/js_handler/admin/pages/stock/context.php
Sorry, but not all translated to vanilla js yet. We are working on this. I'll do everything soon. I think from the examples everything will be clear. When our layout designer aligns everything, then I think it will be visible in the css. You can see this in the bootstrap 5 branch of our project:
https://github.com/musicman3/eMarket/tree/bootstrap-5
from ctxmenu.
Our layout designer has done everything smoothly and beautifully now. Here is a screen:
One problem remains. If the menu is too large, then it goes off the page. It is necessary for the page to move down. Here is a screenshot of the problem:
This problem occurs on the bottom rows of the table.
from ctxmenu.
Thanks for the detailed information. I thought the "off-the-screen" issue was handled, but maybe it only works for the horizontal direction... I've created another issue to track this #14
from ctxmenu.
The off-screen problem occurs on the sub menu. At level 1, everything is fine.
from ctxmenu.
submenus can also switch direction and appear to the left when they reach the end of the screen, see the demo at https://nkappler.de/ctxmenu/ open context menu and select "even more actions".
I though the y coordinate was also working
from ctxmenu.
You only have a horizontal submenu in the demo. I have it horizontally and down. There are many lines down.
from ctxmenu.
Related Issues (20)
- Size calculation wrong when body has a scrollbar and menu would overflow HOT 1
- Allow Esc key press to close the context menu HOT 2
- Make menu appear next to cursor HOT 1
- Suggestion: Change divider color HOT 5
- Error on postinstall script in published version HOT 2
- Position Calculation is wrong when body has css transform bug (2) HOT 19
- Menu is opened at the wrong position when Enter key is pressed HOT 3
- Keyboard navigation HOT 3
- Access parent menu selected target HOT 10
- Support Callback Functions for Submenus
- onMouseEnter/-Leave Events HOT 4
- without tabindex, focus and blur events won't work
- Allow to register an event when the contextual menu is hidden HOT 16
- Submenus containing multiple items may sometimes be displayed outside of the viewport HOT 1
- Add possibility to add classes to item HOT 5
- Microsoft Defender detects it as virus HOT 4
- prevent override on control key down HOT 3
- Adding context menu to multiple elements HOT 4
- get the element which is right clicked HOT 5
- attach a context menu to all items matching selector? HOT 1
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 ctxmenu.