mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-23 15:24:57 +08:00
Improve microinteractions in experiment table [SCI-7540]
This commit is contained in:
parent
7eff083bb7
commit
f6fe827326
2 changed files with 5 additions and 2 deletions
|
@ -138,10 +138,13 @@ var inlineEditing = (function() {
|
|||
.off('click', `${editBlocks} .cancel-button`)
|
||||
.off('blur', `${editBlocks} textarea, ${editBlocks} input`)
|
||||
.on('keyup', `${editBlocks}`, function(e) {
|
||||
var container = $(this);
|
||||
if (e.keyCode === 27) {
|
||||
$(`${editBlocks} .cancel-button`).click();
|
||||
} // Esc
|
||||
|
||||
if (e.keyCode === 13 && !container.find('.view-mode').hasClass('hidden')) {
|
||||
$(editBlocks).click();
|
||||
}
|
||||
})
|
||||
.on('click', editBlocks, function(e) {
|
||||
// 'A' mean that, if we click on <a></a> element we will not go in edit mode
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
data-label-after='<%= config[:label_after]&.html_safe %>'
|
||||
data-placeholder='<%= config[:placeholder] %>'
|
||||
>
|
||||
<div class="view-mode" data-placeholder="<%= config[:placeholder] %>"><%= initial_value %></div>
|
||||
<div class="view-mode" data-placeholder="<%= config[:placeholder] %>" tabindex=0><%= initial_value %></div>
|
||||
<input placeholder="<%= config[:placeholder] %>" class="hidden input-field" type="text" value="<%= initial_value %>" disabled/>
|
||||
<div class="button-container">
|
||||
<span class="save-button"><i class="fas fa-check"></i></span>
|
||||
|
|
Loading…
Reference in a new issue