Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Submenu resize weirdly #308

Closed
RareDevil opened this issue Nov 10, 2015 · 17 comments
Closed

Submenu resize weirdly #308

RareDevil opened this issue Nov 10, 2015 · 17 comments
Assignees
Labels

Comments

@RareDevil
Copy link
Contributor

I have just updated to version 2.0.0 and noticed that the submenu sometimes resize weird and for some reason its missing 1 px in the width even tho the width is not over max-width.
I have made a jsfiddle that shows the problem here: http://jsfiddle.net/RareDevil/vww70pLa/

I'm still trying to find out why this problem is there and i have not yet found the problem.

@bbrala
Copy link
Member

bbrala commented Nov 10, 2015

Hi, ill have a look this week to see what is happening. It seems it happens on the first item of submenu for me?

@bbrala bbrala added the Bug label Nov 10, 2015
@RareDevil
Copy link
Contributor Author

I have updated my jsfiddle to show that is the longest of the items in the submenu that gets to two lines. http://jsfiddle.net/RareDevil/vww70pLa/1/
I have looked at the code and i wonder why is the width added by javascript and not managed with css ? Also i have looked at the sizing and it seems that every time its missing 1px, but i'm still working on pretty fix for this.

I may be looking at making a pull request that removes the width from javascript and let css control it like i have managed to do it in my little project of learning to make jQuery widgets. I decided to make a contextmenu but that was just before swisnl took over this one. There is a sample of the menu here http://raredevil.ovh/contextmenu/

I have manage to fix on my own fork. but the only problem i have right now is that i cant find the src css file i can only locate the dist css file. Is it missing or should i just make a pull request with my change on the dist css file or will the src css come back ?

Here is a fix. Its simple and one line css that was needed: http://jsfiddle.net/RareDevil/vww70pLa/2/

@bbrala
Copy link
Member

bbrala commented Nov 12, 2015

The width with JS is how it always worked, i'm not sure if that is really needed anymore, i'll as the designer @RoachMech to have a look.

In order to generate the new dist files for the CSS you need to have NodeJS and Npm installed. Using npm install in the root of the project should install everything you need to build the CSS from the sass files.

If you want to make changes to the CSS use the SASS files and regenerate the CSS with gulp css.

You can make the changes in https://github.com/swisnl/jQuery-contextMenu/blob/master/src/sass/jquery.contextMenu.scss, if you cant get gulp to run, that is fine too, ill regenerate the files when i accept the pull request.

@RareDevil
Copy link
Contributor Author

I have never used gulp so i just made the changes to the scss file it was just one small line.

@bbrala
Copy link
Member

bbrala commented Nov 16, 2015

I merged the SCSS and updated the dist files. I will walk to @RoachMech and ask him to look tomorrow, since he might've missed my ping.

@RareDevil
Copy link
Contributor Author

Sounds great. Cant wait to hear what will happen when @RoachMech looks at this.

@RareDevil
Copy link
Contributor Author

No news on this one ?

@RoachMech
Copy link
Contributor

I've looked into this and it seems like the entire resize() method is no longer of use and can therefore be removed. @bbrala can you confirm this?

The 1px of the first submenu item is a little optical illusion. It is the border of the submenu, see the attached image.
contextmenu-border

@RareDevil
Copy link
Contributor Author

I cant see how a border can mess up and make the submenu size wrong. If you look at this jsfiddle http://jsfiddle.net/RareDevil/vww70pLa/1/ that i made that have the problem you can see that the first item in the submenu is on 2 lines, this is because for some unknown reason the menu element have a size of XXpx and the size is one pixel of to make the item not be on two lines.

@bbrala
Copy link
Member

bbrala commented Nov 28, 2015

Hmm, think i misunderstood your problem. I see the issue with the second line on IE only. I don't trust myself enough with CSS to fix this, so i'll ask @RoachMech again.

@RareDevil
Copy link
Contributor Author

Whats the status on this? When i have the time to look at this again i will look at better fix for this because if you have a long text in the menu item then it will go out of the menu item.

@bbrala
Copy link
Member

bbrala commented Dec 9, 2015

If you could give it a try that would be awesome. I'll build the css afterwards if you like. Roach seems to have little time available :(

@RareDevil
Copy link
Contributor Author

I don't mind taking the time to fix this properly. Special since i use this a lot and it give me a little break from all the other stuff i make to look at this and find the problem and fix the problem.
Also i have lots of experience with css, html and javascript but when tho i have that there is still more to learn.

@RareDevil
Copy link
Contributor Author

I have manage to fix this problem in my pull request #323 and i dont know why i didnt find this way to fix it before...

@bbrala
Copy link
Member

bbrala commented Dec 17, 2015

Well done, i'll try and have a look soon. :)

@RareDevil
Copy link
Contributor Author

@bbrala Whats the status on this one ?

@bbrala
Copy link
Member

bbrala commented Dec 23, 2015

Checked and merged 👍

@bbrala bbrala closed this as completed Dec 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants