corregir ordenar lineas documentos #1592
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Descripción
$("#salesFormLines").sortable("option", "items", "> .fs-line");
con esto limitamos que los elementos ordenables dentro de #salesFormLines sean las líneas.
$("#salesFormLines").sortable("option", "cursor", "move");
con esto mostramos el cursor del ratón con una cruz de movimiento cuando se están ordenando las líneas
$("#salesFormLines").sortable("option", "cancel", "null");
$("#salesFormLines").sortable("option", "cancel", ".titles");
con estas dos líneas evitamos que al pulsar sobre un input se habilite para poder escribir sin dejarnos ordenar. también evitamos que se pueda seleccionar la linea de titulos.
$("#salesFormLines").sortable("option", "axis", "y");
con esto permitimos que se muevan las líneas solo en el eje y
$("#salesFormLines .fs-line").css('cursor', 'grab');
$("#salesFormLines .fs-line :input").css('cursor', 'grab');
con estas dos líneas cuando habilitamos el sortable, mostramos el cursor del ratón con una manita que invita a coger las líneas y moverlas.
ANTES
DESPUES
¿Cómo has probado los cambios?
Toda modificación debe haber sido mínimamente probada. Marca o describe las pruebas que has realizado: