Patch #24062

Allow only vertical reorderingin sortable lists

Added by Vincent Robert 6 months ago. Updated 4 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:UI
Target version:3.3.2

Description

Here is a patch which allows only vertical reordering for positioned items:

From: Vincent Robert <vincent.robert@nanego.com>
Date: Thu, 13 Oct 2016 12:04:01 +0200
Subject: Vertical reordering only

---
 public/javascripts/application.js | 1 +
 1 file changed, 1 insertion(+)

diff --git a/public/javascripts/application.js b/public/javascripts/application.js
index 087d3de..b303702 100644
--- a/public/javascripts/application.js
+++ b/public/javascripts/application.js
@@ -597,6 +597,7 @@ function beforeShowDatePicker(input, inst) {
     }, options );

     return this.sortable($.extend({
+      axis: 'y',
       handle: ".sort-handle",
       helper: function(event, ui){
         ui.children('td').each(function(){
--

Thank you for considering this tiny contribution ;)

patch.diff Magnifier (727 Bytes) Vincent Robert, 2016-10-13 12:12


Related issues

Related to Redmine - Feature #12909: Drag'n'drop order configuration for statuses, trackers, r... Closed

Associated revisions

Revision 15996
Added by Jean-Philippe Lang 4 months ago

Allow only vertical reorderingin sortable lists (#24062).

Patch by Vincent Robert.

History

#1 Updated by Toshi MARUYAMA 5 months ago

  • Description updated (diff)

#2 Updated by Toshi MARUYAMA 5 months ago

  • Status changed from New to Needs feedback

Please explain more details.

#3 Updated by Vincent Robert 5 months ago

Hi Toshi

As we are sorting elements in a column, we should add this constraint. If we don't specify the axis, we can drag the item to the right or to the left, which does not make sense in our case ; it's cleaner to move them vertically only.

Please try to sort elements with and without the "axis" attribute. You will instantly see the difference.

Thank you

#4 Updated by Toshi MARUYAMA 4 months ago

  • Related to Feature #12909: Drag'n'drop order configuration for statuses, trackers, roles... added

#5 Updated by Toshi MARUYAMA 4 months ago

  • Status changed from Needs feedback to New
  • Target version set to 3.3.2

#6 Updated by Jean-Philippe Lang 4 months ago

  • Status changed from New to Resolved
  • Assignee set to Jean-Philippe Lang

Committed, thanks.

#7 Updated by Jean-Philippe Lang 4 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF