aframevr / aframe-inspector

:mag: Visual inspector tool for A-Frame. Hit *<ctrl> + <alt> + i* on any A-Frame scene.
https://aframe.io/aframe-inspector/examples/
MIT License
655 stars 203 forks source link

Added help modal for shortcuts #344

Closed fernandojsg closed 8 years ago

fernandojsg commented 8 years ago

It shows up when pressing h and close by clicking X or pressing esc

helpmodal

It also fixed a bug as we didn't call stopPropagation when listening for esc key on modals, and we were closing the modal and exiting the inspector at the same time.

Restyled based on @feiss proposal: image

feiss commented 8 years ago

why not closing it with h too instead (or apart from) of esc? I'd expect that h works as a toggle

fernandojsg commented 8 years ago

@feiss Done!, I've added a extraCloseKeyCode as optional parameter to modal, and defined h for the help modal. It will still close if you press esc as most people expect that to works, but h too.

dmarcos commented 8 years ago

Should there be also a button anywhere to toggle help?

fernandojsg commented 8 years ago

@dmarcos Not sure, by now I wouldn't care to add this one for the shortcuts, as I would expect from a help button somewhere on the UI to act as help for the whole inspector. Maybe we could do later a PR modifying this shortcuts modal and add in the top some little text with the links to the inspector and aframe repo or so, and then we could add that help button to the UI

dmarcos commented 8 years ago

it looks good to me. We can rethink help a bit later.

fernandojsg commented 8 years ago

Cool, thanks!