From eb02e713e2b0d83c0a962b7891eea2452c9ca01b Mon Sep 17 00:00:00 2001 From: Guillaume Martigny Date: Thu, 4 Feb 2016 11:53:08 +0100 Subject: [PATCH 1/2] improve the sortable widget with direction, tolerance and handle fix CSS to prevent horizontal scroll Signed-off-by:Guillaume Martigny --- src/css/frames-list.css | 10 ++++------ src/js/controller/FramesListController.js | 7 +++++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/css/frames-list.css b/src/css/frames-list.css index 45d2ecc3..b8e783e6 100644 --- a/src/css/frames-list.css +++ b/src/css/frames-list.css @@ -51,7 +51,7 @@ .preview-list { list-style-type: none; - padding-right: 7px; + padding-right: 9px; } .add-frame-action { @@ -158,13 +158,13 @@ } .preview-tile.selected:after { - content: " "; + content: ""; position: absolute; top: 38px; - right: -15px; + right: -9px; border: transparent 4px solid; border-left-color: gold; - border-width: 6px; + border-width: 6px 0 6px 6px; border-style: solid; } @@ -175,7 +175,5 @@ .preview-tile-drop-proxy { border: 3px dashed gold; - height: 90px; - border-radius: 9px; background-color: rgba(255, 215,0, 0.2); } diff --git a/src/js/controller/FramesListController.js b/src/js/controller/FramesListController.js index 474845bc..510afb21 100644 --- a/src/js/controller/FramesListController.js +++ b/src/js/controller/FramesListController.js @@ -124,9 +124,12 @@ ns.FramesListController.prototype.initDragndropBehavior_ = function () { $('#preview-list').sortable({ - placeholder: 'preview-tile-drop-proxy', + placeholder: 'preview-tile preview-tile-drop-proxy', update: $.proxy(this.onUpdate_, this), - items: '.preview-tile' + items: '.preview-tile', + axis: 'y', + tolerance: 'pointer', + handle: '.dnd-action' }); $('#preview-list').disableSelection(); }; From fc9cb07be1a7d18903a043d594c42870499312ba Mon Sep 17 00:00:00 2001 From: Guillaume Martigny Date: Thu, 4 Feb 2016 15:33:49 +0100 Subject: [PATCH 2/2] Revert to whole frame draggable Signed-off-by:Guillaume Martigny --- src/js/controller/FramesListController.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/js/controller/FramesListController.js b/src/js/controller/FramesListController.js index 510afb21..14706d38 100644 --- a/src/js/controller/FramesListController.js +++ b/src/js/controller/FramesListController.js @@ -128,8 +128,7 @@ update: $.proxy(this.onUpdate_, this), items: '.preview-tile', axis: 'y', - tolerance: 'pointer', - handle: '.dnd-action' + tolerance: 'pointer' }); $('#preview-list').disableSelection(); };