Merge pull request #5173 from scinote-eln/revert-5169-gc_SCI_8098

Revert "Cursor position improvements, focused fields - part 1 (more in addons) [SCI-8098]"
This commit is contained in:
artoscinote 2023-03-21 15:26:20 +01:00 committed by GitHub
commit fb427f7d55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 5 additions and 29 deletions

View file

@ -9,7 +9,6 @@ function applyCreateWopiFileCallback() {
$modal.find('#element_id').val($(this).data('id')); $modal.find('#element_id').val($(this).data('id'));
$modal.find('#element_type').val($(this).data('type')); $modal.find('#element_type').val($(this).data('type'));
$modal.modal('show'); $modal.modal('show');
$($modal).find('#new-wopi-file-name').focus();
return false; return false;
}); });

View file

@ -333,13 +333,6 @@ var ExperimnetTable = {
} }
}); });
}, },
initModalInputFocus: function() {
$(document).on('shown.bs.modal', function() {
var inputField = $('#edit-module-name-input');
var value = inputField.val();
inputField.focus().val('').val(value);
});
},
initMoveModulesModal: function() { initMoveModulesModal: function() {
$('#moveTask').on('click', () => { $('#moveTask').on('click', () => {
this.openMoveModulesModal(this.selectedMyModules); this.openMoveModulesModal(this.selectedMyModules);
@ -646,7 +639,6 @@ var ExperimnetTable = {
this.initMyModuleActions(); this.initMyModuleActions();
this.initRestoreMyModules(); this.initRestoreMyModules();
this.initManageUsersDropdown(); this.initManageUsersDropdown();
this.initModalInputFocus();
} }
}; };

View file

@ -1522,9 +1522,7 @@ function initEditModules() {
}) })
.on("shown.bs.modal", function(event) { .on("shown.bs.modal", function(event) {
// Focus the text element // Focus the text element
var inputField = $('#edit-module-name-input'); $(this).find("#edit-module-name-input").focus();
var value = inputField.val();
inputField.focus().val('').val(value);
}) })
.on("hide.bs.modal", function (event) { .on("hide.bs.modal", function (event) {
// Remove potential error classes // Remove potential error classes
@ -2962,7 +2960,7 @@ function drawRoundRectangle(ctx, xPos, yPos, width, height, radius) {
height = Math.max(height, 0) height = Math.max(height, 0)
if (width < 2 * radius) radius = width / 2; if (width < 2 * radius) radius = width / 2;
if (height < 2 * radius) radius = height / 2; if (height < 2 * radius) radius = height / 2;
ctx.beginPath(); ctx.beginPath();
ctx.lineWidth = 4; ctx.lineWidth = 4;
ctx.strokeStyle = '#104DA9'; ctx.strokeStyle = '#104DA9';

View file

@ -42,6 +42,7 @@ var ProjectsIndex = (function() {
// Init new project folder modal function // Init new project folder modal function
function initNewProjectFolderModal() { function initNewProjectFolderModal() {
var newProjectFolderModal = '#new-project-folder-modal'; var newProjectFolderModal = '#new-project-folder-modal';
// Modal's submit handler function // Modal's submit handler function
$(projectsWrapper) $(projectsWrapper)
.on('ajax:success', newProjectFolderModal, function(ev, data) { .on('ajax:success', newProjectFolderModal, function(ev, data) {
@ -327,13 +328,6 @@ var ProjectsIndex = (function() {
$.get(url, function(result) { $.get(url, function(result) {
$(editProjectModal).find('.modal-content').html(result.html); $(editProjectModal).find('.modal-content').html(result.html);
$(editProjectModal).modal('show'); $(editProjectModal).modal('show');
// focusing at the end of the field
['project_name', 'project_folder_name'].forEach(function(inputId) {
var inputField = $('#' + inputId);
var value = inputField.val();
inputField.focus().val('').val(value);
});
$(editProjectModal).find('.selectpicker').selectpicker(); $(editProjectModal).find('.selectpicker').selectpicker();
$(editProjectModal).find('form') $(editProjectModal).find('form')
.on('ajax:success', function(ev, data) { .on('ajax:success', function(ev, data) {
@ -418,7 +412,7 @@ var ProjectsIndex = (function() {
$(moveToModal).find('.modal-content').html(result.html); $(moveToModal).find('.modal-content').html(result.html);
$(moveToModal).modal('show'); $(moveToModal).modal('show');
initializeJSTree($(moveToModal).find('#moveToFolders')); initializeJSTree($(moveToModal).find('#moveToFolders'));
$('#searchFolderTree').focus();
$(moveToModal).find('form') $(moveToModal).find('form')
.on('ajax:before', function() { .on('ajax:before', function() {
$('<input>').attr({ $('<input>').attr({

View file

@ -323,12 +323,6 @@
}); });
} }
$(document).on('shown.bs.modal', function() {
var inputField = $('#experiment-name');
var value = inputField.val();
inputField.focus().val('').val(value);
});
function initNewExperimentToolbarButton() { function initNewExperimentToolbarButton() {
let forms = '.new-experiment-form'; let forms = '.new-experiment-form';
$(experimentsPage) $(experimentsPage)

View file

@ -328,7 +328,7 @@
<div class="panel-body"> <div class="panel-body">
<div class="form-group"> <div class="form-group">
<label class="control-label">Name</label> <label class="control-label">Name</label>
<input type="text" class="form-control" autofocus onChange="DragNDropResults.validateTextSize(this)" <input type="text" class="form-control" onChange="DragNDropResults.validateTextSize(this)"
rel="results[name]" name="results[name][${i}]"> rel="results[name]" name="results[name][${i}]">
</div> </div>
<div class="form-group"> <div class="form-group">

View file

@ -8,7 +8,6 @@ export default {
$wopiModal.find('#element_id').val(step.id); $wopiModal.find('#element_id').val(step.id);
$wopiModal.find('#element_type').val('Step'); $wopiModal.find('#element_type').val('Step');
$wopiModal.modal('show'); $wopiModal.modal('show');
$($wopiModal).find('#new-wopi-file-name').focus();
$wopiModal.find('form').on( $wopiModal.find('form').on(
'ajax:success', 'ajax:success',