-
Notifications
You must be signed in to change notification settings - Fork 130
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 pop-ups at once when tool buttons are clicked. #750
Comments
Thanks for opening your first issue! This space is protected by our Code of Conduct - and we're here to help. |
@TildaDares I'm willing to work on this, please. |
Good catch @NARUDESIGNS! Go ahead🎉 |
Thank you @TildaDares I will attempt to work on it and revert. |
hey @NARUDESIGNS are you working on it, if you are busy, I can work on it ? |
Hi @NARUDESIGNS, can @RaviAnand111 work on this? |
Sure, @RaviAnand111 can work on it. I'm currently working on completing the conversion of all test files from jasmine tests to jest tests. |
Hey guys, I found out that, to make popups to disappear on click on the page or another pop-up is to add |
@RaviAnand111 You should be able to make those changes in this file PublicLab.Editor/src/adapters/PublicLab.Woofmark.js Lines 318 to 327 in 1ab7b20
|
Hey @TildaDares , where can I find |
Hey @TildaDares @NARUDESIGNS, as in the image, click has been crossed in vs code and on hovering it is saying it has been deprecated so is this function working or not? |
2022-01-08.20-27-04.mp4Hi everyone, I wanted to know your views on it ? Am I missing something here ? |
why are we using older bootstrap version and functions ? |
@RaviAnand111 I think it still works, I've seen some other events crossed in vscode as well. |
I don't know much how popovers work yet but this was the approach I wanted to take: |
Ok, Thanks, @NARUDESIGNS I will try doing that. |
I tried something that worked but it will require a little more code. Here's the snippet I tried: $('.woofmark-command-table').popover({html: true});
+ let popoverIsOpen = false;
$('.wk-commands .woofmark-command-table').click(function() {
+ popoverIsOpen = !popoverIsOpen;
$('.ple-table-size').click(function(e) {
wysiwyg.runCommand(function(chunks, mode) {
var table = createTable(
+Number($('.ple-table-popover #tableCols').text()),
+Number($('.ple-table-popover #tableRows').text())
);
if (mode === 'markdown') chunks.before += table;
else {
chunks.before += _module.wysiwyg.parseMarkdown(table);
setTimeout(_module.afterParse, 0); // do this asynchronously so it applies Boostrap table styling
}
$('.woofmark-command-table').popover('toggle');
});
});
+ $(':not(".woofmark-command-table")').click((e) => {
+ if (popoverIsOpen && !e.target.classList.contains("woofmark-command-table")) {
+ // console.log("popover is opened and should now close");
+ $('.woofmark-command-table').click();
+ }
+ });
}); The lines with the "+" sign are the lines I added. And the file is PublicLab.RichTextModule.Table.js from line 79. This works but with some issues, if you click on any elements in the popover, it will also close the popover since the rule is to close it when any element other than the table button is clicked. This will require more code, but the way I plan to tackle this one is to have all the classes of elements in the popover in an array and do a check against them in the if block. |
This is great, and the idea with array is cool too, I was getting confused in this part of how to shut down pop over when something else is clicked. |
I have also find a way , with least no of code lines. |
Awesome, please share. @RaviAnand111 |
How do I share the code like you did ? @NARUDESIGNS |
` ```javaScript // code in here ``` ` Please use 3 backticks, not 4 |
See the last line with + in this code
By just adding this, button is doing everything we want, execpt one thing, |
OK cool. But I have a question, when you click on the popover itself or any of it's child elements like the |
No, id does not, @NARUDESIGNS |
OK, cool! |
I have a doubt, let me check |
actually, it is disappearing on clicking its child elements, sorry about that, I didn't check it earlier. |
so, now I'd have to write code for popup button and child elements except add button also. |
What do you think ? |
Oh ok, this was the issue with my own approach as well. How do you intend to tackle this? |
I don't know yet, I have solved the problem with the popup button and now it can be used to disappear, now I just have to do the same with child buttons, I will try to do that, and tell you what I got. |
hey guys, I am so sorry, I gave my whole day to this problem and I still couldn't solve it, I am getting more and more confused. |
It's okay @RaviAnand111 we all feel like that sometimes. I'm currently confused with what actions to take for some of my task but we can always communicate to see how we can make progress 💪 |
So for now, you've been able to solve the part where a click on the page or on the table button can hide the popover. But the problem is that when you click on elements in the popover, it also hides the popover right? |
sure, @NARUDESIGNS , thanks, |
yes that is the problem |
Can you please tell me what file you added this line to? |
I'd also work on my initial solution (though it's more code than yours) to see if I'm able to solve this problem you're having as I also have that problem with my initial solution. |
yeah sure, the file is |
Ok, maybe what I can do is to try to fix it, make a PR and we can evaluate the changes together, and based on that, we can solve for other popovers. How about that? |
Ok, I am going to make a PR then |
…and its children fixes publiclab#750
…and its children fixes publiclab#750
…on and its children fixes publiclab#750
…on and its children fixes publiclab#750
#809) * Custom Insert popover hide on clicking on anything on the screen fixes #750 * Custom Insert popover hide on clicking on anything on the screen fixes #750 * Custom Insert popover hide on clicking on anything on the screen fixes #750 Co-authored-by: Tilda Udufo <[email protected]>
#800) * Table popup hide on click on page and everything except table button and its children * Table popup hide on click on page and everything except table button and its children fixes #750 * Table popup hide on click on page and everything except table button and its children fixes #750 * Table popup hide on clicingk on page and everything except table button and its children fixes #750 * Table popup hide on clicingk on page and everything except table button and its children fixes #750 Co-authored-by: Jeffrey Warren <[email protected]>
I clicked on several tool buttons such (e.g table, link etc...) and all corresponding popups occurs. However, they stay on screen until you click again on the icon that triggered the pop-up.
I expect a pop-up to close when I do one of the following:
esc
button,This issue can be replicated on the publiclab editor by clicking the tool buttons as you see in the image above.
The text was updated successfully, but these errors were encountered: