-
Notifications
You must be signed in to change notification settings - Fork 16
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
full screen context menu item added and fixed some context menu related tests #765
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
A good place to start reading about the browsers' Fullscreen API is here; there are likely things in there that would be useful in the code for this PR. |
Found a weird behavior when navigating the history using alt+Arrow keys, when I go back in history many times using the alt+back arrow key, the forward history seems to get deleted, as seen below: Video.mp4Probably because the alt+arrowkeys are still doing something when at the end of history, when they are at the end of history it should just prevent default and not be going forward/backwards - that might be the cause of this. |
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.
A couple of small clarifying changes
Is this on web-map or mapml-viewer? Not sure if it makes a difference, but I noticed that alt+left-arrow is enabled on any div, not just the map div. |
I think it is because pressing it too fast, if you press it once by once, it's working fine, I can try to put a timeout between each time back() and forward() triggers. |
I noticed that if you use "Alt+Left-Arrow" until there is no more history, the "Reload" button does not become disabled, until you actually reload / Ctrl-R. That is, when you pop the last history item, it should disable the reload button. |
I don't really see this problem at my side, when there's no more history, the reload is disabled. It should be the same as before since I did not really touch the functions. |
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.
code structure change
I think we can revert the settimeout change and look at async await if possible. With the settimeout, we are only able to go back with intervals of 0.5 seconds. So If I were to go back twice within 0.5 secs, It would only go back once: Video.mp4 |
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.
A few comments. Almost there!
src/mapml-viewer.js
Outdated
this._map.contextMenu._items[0].el.el.disabled = false; // back contextmenu item | ||
this._map.contextMenu._items[2].el.el.disabled = false; // reload contextmenu item | ||
this._map.contextMenu.toggleContextMenuItems("Back", "enabled"); // back contextmenu item | ||
this._map.contextMenu.toggleContextMenuItems("Reload", "enabled"); // reload contextmenu item |
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.
Here is where you should also enable the reload button on the map.
src/mapml-viewer.js
Outdated
this._map.contextMenu._items[2].el.el.disabled = true; // reload contextmenu item | ||
this._map.contextMenu.toggleContextMenuItems("Back", "disabled"); // back contextmenu item | ||
this._map.contextMenu.toggleContextMenuItems("Forward", "disabled");// forward contextmenu item | ||
this._map.contextMenu.toggleContextMenuItems("Reload", "disabled"); // reload contextmenu item |
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.
Here is where you should also disable the reload button on the map
@Jacky0299 I pushed some changes (pull them and have a look!) that maybe weren't clear; I left the comments above so you can compare what I did with what the comment asked for. |
@Jacky0299 Squash and merge when ready. |
text: M.options.locale.cmBack + " (<kbd>Alt+Left Arrow</kbd>)", | ||
callback:this._goBack | ||
}, | ||
{ | ||
text: M.options.locale.cmForward + " (<kbd>F</kbd>)", | ||
text: M.options.locale.cmForward + " (<kbd>Alt+Right Arrow</kbd>)", |
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.
Looks good, just dont forget to add localized versions of this in the extension, similar to what you did for "Exit Fullscreen". Create a PR for the extension.
Nice Work on this!
…ed tests (Maps4HTML#765) * full screen context menu item added and fixedtests * weird test: Checking Context Menu Fullscreen * ready for review * Fix fullscreen test and remove scrolling * minor changes * ready to merge * bug fix (esc button), Peter suggested functions * forward reload back fullscreen button changes * minor changes * Linting * Change "View fullscreen" to "View Fullscreen" * minor linting * Aliyan suggested styling changes * time out added between each time back is pressed * disabling reload button * bugs fix and new context menu functions * sync changes with web map * peter suggested changes * Tweak to mapml-viewer, web-map --------- Co-authored-by: AliyanH <aliyanulhaq@gmail.com> Co-authored-by: Peter Rushforth <peter.rushforth@gmail.com> Co-authored-by: prushfor <prushfor@L-BSC-A146390.nrn.nrcan.gc.ca>
New "Exit Fullscreen" locale added to the mapml-extension here: Maps4HTML/mapml-extension@c446c54
solves issue #201