Project

General

Profile

Actions

Patch #24062

closed

Allow only vertical reorderingin sortable lists

Patch #24062: Allow only vertical reorderingin sortable lists

Added by Vincent Robert about 10 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Normal
Category:
UI
Target version:

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 ;)


Files

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

Related issues 1 (0 open — 1 closed)

Related to Redmine - Feature #12909: Drag'n'drop order configuration for statuses, trackers, roles...ClosedJean-Philippe LangActions

Updated by Toshi MARUYAMA about 10 years ago Actions #1

  • Description updated (diff)

Updated by Toshi MARUYAMA about 10 years ago Actions #2

  • Status changed from New to Needs feedback

Please explain more details.

Updated by Vincent Robert about 10 years ago Actions #3

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

Updated by Toshi MARUYAMA almost 10 years ago Actions #4

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

Updated by Toshi MARUYAMA almost 10 years ago Actions #5

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

Updated by Jean-Philippe Lang almost 10 years ago Actions #6

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

Committed, thanks.

Updated by Jean-Philippe Lang almost 10 years ago Actions #7

  • Status changed from Resolved to Closed
Actions

Also available in: PDF Atom