enable scroll for overflowing categories, clone cards to move out of scrollable wrapper

This commit is contained in:
i-break-codes
2017-02-22 00:24:05 +05:30
parent 2d5a35a687
commit 8eae0cb335
2 changed files with 12 additions and 7 deletions

View File

@@ -118,14 +118,18 @@ var App = function() {
function draggable() { function draggable() {
$('.card').draggable({ $('.card').draggable({
handle: 'h5', handle: 'h5',
revert: true, revert: false,
cursor: 'move', helper: function(e) {
start: function(event, ui) { //Cloning element, to enable draggable elements move out of scrollable parent element.
var original = $(e.target).hasClass("ui-draggable") ? $(e.target) : $(e.target).closest(".ui-draggable");
return original.clone().css({
width: original.width()
});
}, },
stop: function(event, ui) { scroll: false,
cursor: 'move',
} start: function(event, ui) {},
stop: function(event, ui) {}
}); });
} }

View File

@@ -126,6 +126,7 @@ header {
height: 100%; height: 100%;
border-right: 1px solid $base-color; border-right: 1px solid $base-color;
width: 20%; width: 20%;
overflow: scroll;
} }
} }