This does not work when editing an existing record or when creating a new record in basic editor mode. To test: 1. Open any Biblio and edit that record. (select "Edit record" from the "Edit" drop-down menu). 2. Repeat any tag that may be repeated and has more than one subfield (e.g. 050 or 082) (click "Repeat this tag") 3. that when you try dragging a subfield of the new repeated tag, the entire new tag moves.
Created attachment 159196 [details] [review] Bug 35383: Make subfields of repeated tags draggable To reproduce: 1. Open any biblio and edit that record. (select "Edit record" from the "Edit" drop-down menu). 2. Repeat any tag that may be repeated and has more than one subfield (e.g. 050 or 082) (click "Repeat this tag") 3. Try dragging a subfield of the new repeated tag Apply the patch and make sure dragging a subfield works well.
Created attachment 159202 [details] [review] Bug 35383: Make subfields of repeated tags draggable To reproduce: 1. Open any biblio and edit that record. (select "Edit record" from the "Edit" drop-down menu). 2. Repeat any tag that may be repeated and has more than one subfield (e.g. 050 or 082) (click "Repeat this tag") 3. Try dragging a subfield of the new repeated tag Apply the patch and make sure dragging a subfield works well. Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Created attachment 159233 [details] [review] Bug 35383: Make subfields of repeated tags draggable To reproduce: 1. Open any biblio and edit that record. (select "Edit record" from the "Edit" drop-down menu). 2. Repeat any tag that may be repeated and has more than one subfield (e.g. 050 or 082) (click "Repeat this tag") 3. Try dragging a subfield of the new repeated tag Apply the patch and make sure dragging a subfield works well. Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Thanks for your patch, Slava. My only concern would be the assumption that Sortable is defined. In the current codebase this seems to be the case (called from authorities.tt or addbiblio).
(In reply to Marcel de Rooy from comment #4) thanks, that makes a sense, I can wrap up it in "if", if (typeof Sortable !== 'undefined') { $(clone).find("ul.sortable_subfield").each((i, e) => { Sortable.create(e, { animation: 150, }); }); } but the best then is to make a callback option for CloneSubfield and leave Sortable.create code in files where it resides, but that also leads to refactoring of onclick="CloneSubfield... to modern way how we doing that in our codebase by moving that listener to JS document ready block Marcel, what do you think?
(In reply to Slava Shishkin from comment #5) > (In reply to Marcel de Rooy from comment #4) > > thanks, that makes a sense, > > I can wrap up it in "if", > > if (typeof Sortable !== 'undefined') { > $(clone).find("ul.sortable_subfield").each((i, e) => { > Sortable.create(e, { > animation: 150, > }); > }); > } > > but the best then is to make a callback option for CloneSubfield and leave > Sortable.create code in files where it resides, > > but that also leads to refactoring of onclick="CloneSubfield... to modern > way how we doing that in our codebase by moving that listener to JS document > ready block > > Marcel, what do you think? You are welcome to improve it. Please do so on a new report. I think that this patch can go in now in its current form. Your commitment is appreciated.
(In reply to Marcel de Rooy from comment #6) > You are welcome to improve it. Please do so on a new report. I think that > this patch can go in now in its current form. Your commitment is appreciated. Ok, then I'll leave it in its current state and start working on refactoring. I will create a new ticket for that.
Pushed for 24.05! Well done everyone, thank you!
Pushed to 23.11.x for 23.11.01
Cannot reproduce the problem in 23.05.x, no backport.