-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Executing cell when clicking its prompt #3535
Conversation
(Repeating my comment from #1009) Interesting idea! I have some concern that people might be used to clicking on the prompt to select a cell without going into edit mode, and if that suddenly executes the cells, it could be an unpleasant surprise - especially for cells which take a long time to run. I'll try to think about how we might test it out. |
Thanks for the feedback! I'll think about it |
I like this idea for mouse-driven use, though it doesn't help so much on a touchscreen. Maybe we can use some CSS media queries to make these buttons always visible on touch devices? There's a test failure where a test checks the HTML of the input prompt. |
I have searched a media query for touchscreen devices. I am using any-pointer: coarse. It worked on Chrome, but didn't worked on Firefox, maybe with some javascript it can be solved... I have also fixed that test failure, now the button is outside the prompt div. |
@takluyver Sadly, |
It looks like it's mainly Firefox that doesn't support it, but there's a non-standard @media (-moz-touch-enabled: 1), (pointer: coarse) {
// Rules for touch screens
} https://developer.mozilla.org/en-US/docs/Web/CSS/@media/-moz-touch-enabled |
That worked here, on a touchscreen computer. Thanks! |
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.
I've tested this briefly interactively, and it looked good.
var run_this_cell = $('<div></div>').addClass('run_this_cell'); | ||
run_this_cell.prop('title', 'Run this cell'); | ||
run_this_cell.append('<i class="fa-step-forward fa"></i>'); | ||
run_this_cell.mouseup(function (event) { |
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.
Is there a reason to do this on the mouseup event rather than the click event? I think we usually use click.
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.
Ok, I'll replace it with click event
Thanks, let's see how this works out. I may ping you if there are issues with it. |
…yter#3535 Without this change the output and Input areas become unaligned. This still isn't an ideal fix, but it'll make a release possible without making the styling problematic.
add el & update css in output_area to match run button in input prompt from #3535
Closes #1009. Based on #3437. When clicking on a prompt, executes the corresponding cell.