jakiestfu / context.js Goto Github PK
View Code? Open in Web Editor NEWContextual Menus with Twitters Bootstrap.css
Home Page: http://lab.jakiestfu.com/contextjs/
Contextual Menus with Twitters Bootstrap.css
Home Page: http://lab.jakiestfu.com/contextjs/
If set to 'auto', menu should appear as a "dropleft" or "dropright" if there is not enough room left to the right or left. Settings to true should make the menu a "popleft" or "popright" by default.
Hi!
First off, this tool's really great, thanks a lot for releasing it. I've attached the context menu to a class of elements in my code, and I want to access the element from which the context menu was raised. Is there a clean way to do it? I'm looking for something like the following:
context.attach(".my-class", [
{text: 'Act on right-clicked element', action: function(e){
e.preventDefault();
// Is there a way to get a selector for the clicked item?
}}]
I have tested on mobile phone on "tap" either "taphold" events and nothing happened. Is there somebody to give an advice?
Thank you for a very nice library @jakiestfu .
I am trying to use it with Bootstrap 4.6.
The standalone version works fine, but when using the Bootstrap version for more consistent styling, there seems to be no padding etc.
Has the library been tested for later versions of bootstrap? Is there any plan for adding that support?
Would you be accepting PRs for the same?
I just found Your great plugin, it works awesome!
I was trying to plug it into my existing site that uses Bootstrap 3, but I noticed that dividers are missing and submenus are showing below main menu.
Does this plugin supports Bootstrap 3? Maybe You did some adaptations?
We at VersionEye are working hard to keep up the quality of the bower's registry.
We just finished our initial analysis of the quality of the Bower.io registry:
7530 - registered packages, 224 of them doesnt exists anymore;
We analysed 7306 existing packages and 1070 of them don't have bower.json on the master branch ( that's where a Bower client pulls a data ).
Sadly, your library jakiestfu/Context.js
is one of them.
Can you spare 15 minutes to help us to make Bower better?
Just add a new file bower.json
and change attributes.
{
"name": "jakiestfu/Context.js",
"version": "1.0.0",
"main": "path/to/main.css",
"description": "please add it",
"license": "Eclipse",
"ignore": [
".jshintrc",
"**/*.txt"
],
"dependencies": {
"<dependency_name>": "<semantic_version>",
"<dependency_name>": "<Local_folder>",
"<dependency_name>": "<package>"
},
"devDependencies": {
"<test-framework-name>": "<version>"
}
}
Read more about bower.json on the official spefication and nodejs semver library has great examples of proper versioning.
NB! Please validate your bower.json with jsonlint before commiting your updates.
Thank you!
Timo,
twitter: @versioneye
email: [email protected]
VersionEye - no more legacy software!
Hello,
Great library thanks for the sharing.
I have a problem in my app. The context menu always appear on top of my mouse like if I am on the bottom of the page. I wonder if it is because of my html. I use it in the context of a Wakanda application inside of a grid widget.
Do you have any advise to force the context menu to open on bottom of my mouse?
Is there an option available that I'm missing which would allow the context menu DOM elements to not be created until it is needed to be displayed?
$(document).on("contextmenu", selector, function (e, ext) {
e.preventDefault();
e.stopPropagation();
if (!e.pageX && ext && ext.event) {
// trigger
e = ext.event;
}
// ...
}
i use Context.js like this:
context.attach(".classA",menuArr1);
context.attach(".classB",menuArr2);
but sometimes(i have a test,about twenty times occur five times ),it attach menuArr2 to classA items!
i don't have any ideas?what is the matter?
Hi, I'm not sure if this repo is still maintained or not, but I'd appreciate some help please.
I need to put some sub-menu items into my context menu, but they are behaving strangely. They appear underneath the main context menu, and I am unable to move to them to click them before they disappear.
I initially thought that this was some conflicting custom css I had, but I've made a menu from scratch on plunker and it does the same.
If you try to select something from the 'sub menu' section you'll see what I mean.
http://plnkr.co/edit/2AcaQb?p=preview
Hopefully I've just done something stupid, and this isn't related to a newer version of BS or the like. Can you help at all?
Many thanks.
hi,
i have DOM which i'm trying to loading context js inside a iframe it's not loading .so can u please reply quickly with some answer
Thanks Regards,
sandeep
when you do context.attach('selector', ...).
Is there a way inside the menu items callback function to get the DOM object of the item that you right clicked on?
When I installed the current version via Bower, it installed the latest commit, I think it would be very useful to tag the current version at the master branch.
$dd
.css({
top: e.pageY + 10,
left: e.pageX - 13,
zIndex: 999999999,
})
.fadeIn(options.fadeSpeed);
I have been fascinated by the beauty of Context.js. However, it is not clear for me how to get the information from the clicked element. Lets say I have an anchor that has some data attributes like this:
< a data-id="10" data-made="2014" data-type="car" data-color="red" href="#" >Ferrari< /a >
How can I get those data stuff?
I tried to use (this), but it returns the context menu itself.
Hi,i would like to ask if it's possible to enable or disable menu item via code programtically?Thanks a lot.
Meaning if have a list of items and I right click the third one, choose delete (which has an 'action' handler) the handler only receives click event on the menu entry, not on the third item in the list.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.