Skip to content
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

Add key bindings to move things around the dashboard editor #9

Merged
merged 4 commits into from
Sep 5, 2016

Conversation

mattjgalloway
Copy link
Contributor

This adds key bindings when on the dashboard editor so that you can move items around with the arrow keys. Items move by 1 grid size unit in whichever direction of arrow you press.

@Paul-Reed
Copy link
Member

I was about to comment on that!!
Thanks

@Paul-Reed
Copy link
Member

It's still not happening for me, I have your latest version of designer.js and the arrow keys have no effect other than move the page up or down a little.
Using windows 10, tried Firefox, Chrome & Explorer (current versions), clearing their caches, even trying incognito windows to no avail.

@mattjgalloway
Copy link
Contributor Author

@Paul-Reed - Hmm that's weird! I'm mainly using Chrome, but it also works for me in Safari. How odd! I'm using a Mac, but I can't believe that would make a difference here. Unless the key code is different for the arrow keys...

What does this website say when you press the arrow keys on your keyboard?
http://keycode.info/

@Paul-Reed
Copy link
Member

37, 38, 39 & 40, identical to your commit.

@mattjgalloway
Copy link
Contributor Author

@Paul-Reed - can you try with that latest commit please? I switched it to binding through jquery which may standardise things across browsers/OSes for us.

@Paul-Reed
Copy link
Member

The jquery switch on your last commit has now enabled the arrow keys. and appear to be now working as intended. Great!
I'll do a little more testing, but it's looking good, and especially as it nudges the grid distance which is now user selectable.

@mattjgalloway
Copy link
Contributor Author

Yeh, I found this incredibly useful. Moving things around by dragging the centre is rather frustrating especially when the centre isn't very visible (thus hard to find) due to the colour of the widget.

@Paul-Reed
Copy link
Member

Thanks Matt, works fine now provided the cache is refreshed to clear the javascript. No errors, and no detrimental issues for android/ios.
Two very much appreciated merges 👍

@Paul-Reed Paul-Reed merged commit 0f8a2ec into emoncms:master Sep 5, 2016
@Paul-Reed
Copy link
Member

Matt, one thing that I have found;
If moving objects with a mouse, it was extremely difficult to move objects off of the page, so they could always be recovered.
However, using the arrow keys, objects can be moved off-page, and if focus is lost they cannot be retrieved/deleted.
Could restrictions be applied to stop this?

Paul

@mattjgalloway
Copy link
Contributor Author

Ah yes. That'll need fixing. Good spot. I'll work on that ASAP.

I've always wondered why the page isn't infinite anyway, and just scroll as far as is needed to view every element. But maybe there's a reason why that is hard to implement.

On 5 Sep 2016, at 23:01, Paul Reed notifications@github.com wrote:

Matt, one thing that I have found;
If moving objects with a mouse, it was extremely difficult to move objects off of the page, so they could always be recovered.
However, using the arrow keys, objects can be moved off-page, and if focus is lost they cannot be retrieved/deleted.
Could restrictions be applied to stop this?

Paul


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@mattjgalloway mattjgalloway deleted the dashboard_edit_key_bindings branch September 6, 2016 08:38
@mattjgalloway
Copy link
Contributor Author

@Paul-Reed - fixed with #10.

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.

2 participants