Skip to content

Resize only with ctrl#705

Open
studywolf wants to merge 5 commits into
masterfrom
resize_only_with_ctrl
Open

Resize only with ctrl#705
studywolf wants to merge 5 commits into
masterfrom
resize_only_with_ctrl

Conversation

@studywolf
Copy link
Copy Markdown
Contributor

Just added an event handler for items that checks the key pressed, if it's ctrl then it sets 'resizable' to false, and then back to true when the key is let up. The idea is just to make it easier to move around items. I've often had it when an ensemble or whatnot is small and I can't click on it to move without zooming in, i'm only able to resize. So this addresses that!

Addresses #625, uses ctrl instead of alt because alt is a thing in chrome.

Based on #704, which should be merged first!

@studywolf
Copy link
Copy Markdown
Contributor Author

oops, apparently this also has the ng fix in there toooooo...best course of action @tbekolay ?

@tbekolay
Copy link
Copy Markdown
Member

You can either rebase this branch to master, or you can just note that this branch is based on #704 and should be merged first.

@studywolf
Copy link
Copy Markdown
Contributor Author

done! thanks!

@tcstewar
Copy link
Copy Markdown
Contributor

Hmm... for me (on Chromium), once I touch Ctrl I can no longer resize any of the components. It's like the keyup never happens at all. Does that happen to you?

@studywolf
Copy link
Copy Markdown
Contributor Author

hmm nope it clicks back as soon as i let go, i'm using Google Chrome 49.0.2623.87 on ubuntu 14.04

}
});
$(document).bind('keyup', function(event) {
interact(self.div).resizable(true);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this be inside an if (event.ctrlKey) check?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes it should!

@tcstewar
Copy link
Copy Markdown
Contributor

hmm nope it clicks back as soon as i let go, i'm using Google Chrome 49.0.2623.87 on ubuntu 14.04

Weird... It's failing for me on Chrome 44.0.2403.107 as well... And firefox 36.0.4... (on Mint 17) those are both old versions, but still, everything else works on them.... I'll poke around on other machines...

@studywolf
Copy link
Copy Markdown
Contributor Author

hmm yeah i'm on my workstation now and getting some weird behaviour from this. i'll double check things on my laptop when i'm back home tonight...

@studywolf
Copy link
Copy Markdown
Contributor Author

looks like it should be checking the keycode on keyup instead of ctrlKey, can you try it now @tcstewar?

@tcstewar
Copy link
Copy Markdown
Contributor

looks like it should be checking the keycode on keyup instead of ctrlKey, can you try it now @tcstewar?

That fixes it for me on Chrome and Firefox :)

One small thing: could there be a comment added to indicate that keyCode===17 is the ctrl button?

@studywolf
Copy link
Copy Markdown
Contributor Author

comment added!

@tcstewar
Copy link
Copy Markdown
Contributor

Cool.... and one more thing -- it should probably be added to the hotkeys text. :)

@studywolf
Copy link
Copy Markdown
Contributor Author

hmmmm how would you describe this? Temporarily disable resize? Easy move? ...??

@tcstewar
Copy link
Copy Markdown
Contributor

hmmmm how would you describe this? Temporarily disable resize? Easy move? ...??

Hmm... I think just "Disable resize..............Ctrl" should be okay....

@studywolf
Copy link
Copy Markdown
Contributor Author

k!

On Tue, Mar 22, 2016 at 3:55 PM, tcstewar notifications@github.com wrote:

hmmmm how would you describe this? Temporarily disable resize? Easy move?
...??

Hmm... I think just "Disable resize Ctrl" should be okay....


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#705 (comment)

@studywolf
Copy link
Copy Markdown
Contributor Author

added!

Use self-documenting code instead of comment.
Be consistent in use of key codes instead of ctrlKey flag.
@jgosmann
Copy link
Copy Markdown
Collaborator

jgosmann commented Aug 2, 2016

Added a commit to use self-documenting code instead of comments and to be consistent with the use of key codes (instead of the ctrlKey flag).
Apart from that this LGTM. 🍰

@mgserafi
Copy link
Copy Markdown

Tested and confirmed it still works in Chrome.
LGTM! (just learned what that means)

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

Labels

Development

Successfully merging this pull request may close these issues.

5 participants