Bug 36388: Mouse operation does not work in draggable fields in authority editor

When using the authority editor in Firefox, it is not possible to set
the cursor or select text from the text field.

This patch mimics the corrections made in bug 35425 for biblio editor.

Test plan:
==========
1. Start editing an existing authority record and try to put the cursor
   with the mouse in the middle of the content of any subfield or to
   select text with the mouse. It should not be possilbe.
2. Apply the patch (reload plack etc.).
3. Repeat p. 1 - everything should work as expected.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6e09fb6ad8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Janusz Kaczmarek 2024-03-21 16:20:24 +01:00 committed by Fridolin Somers
parent 268e6bf0ff
commit e867769d09
3 changed files with 16 additions and 20 deletions

View file

@ -48,17 +48,8 @@
selectTab( "#tab0XX_panel" );
}
$("#authoritytabs ul.sortable_field").each( (i, e) => {
Sortable.create(e, {
animation: 150
});
});
$("#authoritytabs ul.sortable_subfield").each( (i, e) => {
Sortable.create(e, {
animation: 150
});
});
initializeSortable("#authoritytabs ul.sortable_field");
initializeSortable("#authoritytabs ul.sortable_subfield");
Sticky = $("#toolbar");
Sticky.hcSticky({
@ -556,6 +547,9 @@
<div class="tag_title" id="div_indicator_tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]">
[% UNLESS hide_marc %]
[% IF ( innerloo.repeatable ) %]
<span class="handle">&#xf58e;</span>
[% END %]
[% IF advancedMARCEditor %]
<a href="#" tabindex="1" class="tagnum" title="[% innerloo.tag_lib | html %] - Click to expand this tag" data-field_id="tag_[% innerloo.tag | html %]_[% innerloo.index | html %][% innerloo.random | html %]'">[% innerloo.tag | html %]</a>
[% ELSE %]
@ -638,6 +632,7 @@
[% UNLESS hide_marc %]
<div class="subfieldcode">
<span class="handle">&#xf58e;</span>
<input type="text"
title="[% subfield_loo.marc_lib | $raw %]"
style=" [% IF ( subfield_loo.fixedfield ) %]display:none; [% END %]border:0;"

View file

@ -78,15 +78,6 @@
selectTab( "#tab0XX_panel" );
}
function initializeSortable(selector) {
$(selector).each((i, e) => {
Sortable.create(e, {
handle: '.handle',
direction: 'vertical',
animation: 150,
});
});
}
initializeSortable("#addbibliotabs ul.sortable_field");
initializeSortable("#addbibliotabs ul.sortable_subfield");

View file

@ -603,6 +603,16 @@ function CheckImportantSubfields(p){
return total;
}
function initializeSortable(selector) {
$(selector).each((i, e) => {
Sortable.create(e, {
handle: '.handle',
direction: 'vertical',
animation: 150,
});
});
}
$(document).ready(function() {
$("input.input_marceditor, input.indicator").addClass('noEnterSubmit');
$(document).ajaxSuccess(function() {