-
Notifications
You must be signed in to change notification settings - Fork 129
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
Multiple popups open up at a time #793
Conversation
@RaviAnand111 I fixed this but with more lines of code. I noticed that even bootstrap's example couldn't close when you click again on the button but only closes when you click outside it. So I couldn't find a resolution through bootstrap which made me write more lines of code. |
Or would you prefer me to share with you the code snippet I added so that you can try it on your local environment and then push the changes? |
Both are fine @NARUDESIGNS you can share or make a PR whichever sounds good to you, as soon as you push it can we try to find ways to solve this. |
Hi @NARUDESIGNS, to make it easier for @RaviAnand111 to incorporate those changes you can make use of GitHub suggestions. |
Thank you @TildaDares but his commits didn't include lines where I wanted to indicate the changes. I thought of making a PR cause I don't know if this can explain it enough but let me try this first. + let popoverIsOpen = false;
$('.wk-commands .woofmark-command-table').click(function() {
+ popoverIsOpen = !popoverIsOpen;
$('.ple-table-size').click(function() { $('.woofmark-command-table').popover('toggle');
});
});
+ // close table popover when user click outside the page
+ $(':not(".woofmark-command-table")').click((e) => {
+ // check to see that the clicked element isn't fa-table icon, else when you click on the fa-table icon, the popover will close
+ if($('.woofmark-command-table').children()[0] != e.target){
+ const popoverContainer = document.querySelector('.popover');
+ const isChildElement = popoverContainer.contains(e.target);
+ if (popoverIsOpen && !e.target.classList.contains("woofmark-command-table") && !isChildElement) {
+ $('.woofmark-command-table').click();
+ }
+ }
+ });
});
}; |
I hope this helps. |
Thanks @NARUDESIGNS , I will add them in the code and make a commit here. |
Hey @NARUDESIGNS, you have written a very beautifull code, if is working perfectly. |
Thank you @RaviAnand111 even though I feel like it's many lines of code for a simple task but you get the idea or pattern we can use for the other popovers right?
|
I got it, @NARUDESIGNS |
Alright. At Public Lab, I learned that a PR should do just one thing (unless there are very minimal changes you want to group together). So I think we should make separate PRs for each tool button that has popovers. You can make changes for this table button and commit it then create another PR for any other tool button you'd like to work on next. |
ok great, then I will do it the way you said, and different PRs for different popovers. |
I just pushed the new changes, you can check and tell me if there is something to change. |
I just had this doubt, @NARUDESIGNS as in the end all the code in modules become part of |
The |
I tried both ways, with different variable names and with same variable names and I found out that both ways are working perfectly, there is not problem, so what do you recommend which way should I do it ? |
Well for sake of consistency, let's just use same one for all. |
I am adding the function in try catch as it is printing errors in console on clicking on the page as the contains function is being called on null. |
Is this for a different tool button and popover? |
See this is the error in the console, what I have understood is,
|
Yea I noticed. I dropped a suggestion for you. Please check. |
hey @NARUDESIGNS , sorry to ask, where can I see the suggestion, I can't find any. |
Yea there are too many comments already so I'd just paste it here:
|
I am adding the same video from the other PR, if any more demo video is required, then I will make another video multiple-popover-bug.mp4You can check the demo video |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
Hi, @RaviAnand111 there are 10 commits in this PR and some of the commits are from another PR. This usually happens when you checkout a new branch X from another branch Y, the commits from branch Y are automatically added in new branch X. Did you checkout this branch from |
I think I have made a mistake here, and checkout a new branch from a branch, |
Not to worry, I made same mistake some time when I joined as well. Tilda shared a very helpful resource, have a look at it here - https://luisdalmolin.dev/blog/branched-off-the-wrong-branch-in-git/ |
hey @NARUDESIGNS I think I have done a massive mistake here. Can you tell me how to solve, I am confused right now |
I'm sorry, I don't really get your diagram but all the commits here are still in place. Maybe what you can do is @TildaDares can you please help to check in that we are on track to resolve the issue @RaviAnand111 is having, thank you. |
My mistakes:
It seems messed up, what should I do ? |
@RaviAnand111 Have you tried this? |
Yeah, I tried this, it is giving merge conflict and something, I think the main mistake I did was, made a change and PR from |
I think I should create a new branch, before I created a PR from main and |
@RaviAnand111 It’s best to leave the main branch untouched and use branches for your work. I’m looking for resources to help with your issue. |
Yes I learned my lesson from this mistake, thankyou for helping me, |
@RaviAnand111 I found this article about how to rebase. You could pick and drop the commute you want in this PR. https://www.google.com/amp/s/www.digitalocean.com/community/tutorials/how-to-rebase-and-update-a-pull-request.amp |
Hey guys, I tried to solve this so I will write down what steps I took :
I think I should make a video with sketch and drawing to make you guys understand, if you guys ask for it then I will make one. so now we are here, now head is at the commit in which I have not pushed a PR yet, but the PR's I have done already are showing those previous files. So I am thinking of closing those PR's and creating new one's |
Hello @RaviAnand111 Maybe we need to just start the whole process all over since your main branch is now properly synced with that of publiclab.
How about that? |
That sounds good @NARUDESIGNS , |
And one more thing, |
Hi @RaviAnand111, you can follow those steps @NARUDESIGNS outlined. You can also close these PRs when you’ve opened the new ones. Thanks! |
Thanks @NARUDESIGNS @TildaDares |
fixes #750
This is the code I have done, all the improvement I had done till yesterday, I have deleted it this code just has the code I talked about in the issue chats, now we can discuss and find a way to solve this problem.
Thank You
@NARUDESIGNS @TildaDares