Skip to content

Comments

Popup Disappearing problem solved#3

Merged
jywarren merged 6 commits intojywarren:plots2from
NitinBhasneria:popup-nitin
Jun 24, 2020
Merged

Popup Disappearing problem solved#3
jywarren merged 6 commits intojywarren:plots2from
NitinBhasneria:popup-nitin

Conversation

@NitinBhasneria
Copy link

@NitinBhasneria NitinBhasneria commented Jun 8, 2020

Fixes: publiclab/PublicLab.Editor#407

Presently the toolbar popup is not disappearing. After this fix, if we click anywhere else the popup will disappear.
popup
In this PR, a new crossvent function is added, this function will be called when we click anywhere except the popup box.

@NitinBhasneria
Copy link
Author

Copy link

@VladimirMikulic VladimirMikulic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please resolve minor issues.

@NitinBhasneria
Copy link
Author

We can also add a scroll event. By this when we scroll the page the popup will disappear, which in turn makes the user experience better.
@VladimirMikulic @Shreyaa-s @keshav234156 @Shulammite-Aso @jywarren . What do you think?

@Shulammite-Aso
Copy link

Yes @NitinBhasneria I think anything that means focusing outside of the pop-up should make it disappear.

@VladimirMikulic
Copy link

@NitinBhasneria maybe it's not a bad idea but it should trigger on a "bigger" scroll. Triggering popup removal on a slight scroll (a few pixels) which I sometimes accidentally do (others probably do as well) on my trackpad would be annoying to the users.

Copy link

@VladimirMikulic VladimirMikulic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last change :)

@NitinBhasneria
Copy link
Author

Ok thanks for the idea @jywarren @VladimirMikulic

@NitinBhasneria
Copy link
Author

@VladimirMikulic @jywarren Have a look now.
I have added onscroll function which will make the popup disappear after more than 10 scrolls.
popup

@jywarren
Copy link
Owner

This looks really good! but @VladimirMikulic were you saying you think it may need to be on a scroll of more than X pixels, rather than a repeated scroll?

Just to clarify before we get ready to merge this!

And, once we decide the exact behavior we want, @NitinBhasneria can you rename the title and first line of description above to clearly lay out the change in behavior? This will help us produce good documentation and track all the changes that go into each release.

Thank you!!! 🙌

// Disappearing the popup when scrolled.
window.onscroll= function() {
scrollSize++;
if (scrollSize>10) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be formatted correctly.

}

function rootClick (e) {
var classlist = e.target.classList.value;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

classlist is too generic. Which element is this that we are referencing? Also, follow the camelCase naming convention.

dom.input.focus();
}

function rootClick (e) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function needs to be documented.

@VladimirMikulic
Copy link

@jywarren Nitin covered the case I mentioned. 👍

@jywarren
Copy link
Owner

OK, great! Thanks, everyone! @NitinBhasneria once this is done could you open a PR to bump the version number on woofmark so that we can publish it and pull it into the editor repo? Thanks!!

@jywarren jywarren merged commit 59efdf2 into jywarren:plots2 Jun 24, 2020
@NitinBhasneria
Copy link
Author

OK, great! Thanks, everyone! @NitinBhasneria once this is done could you open a PR to bump the version number on woofmark so that we can publish it and pull it into the editor repo? Thanks!!

created #6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Popup not disappearing

4 participants