From 95b3f0d7de7b872091d4ad91fb9456552c6d11a9 Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Tue, 9 Oct 2012 13:13:44 -0400 Subject: [PATCH] Make component drag-and-drop a little nicer --- cms/static/coffee/src/views/unit.coffee | 5 +++++ cms/static/sass/_unit.scss | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/cms/static/coffee/src/views/unit.coffee b/cms/static/coffee/src/views/unit.coffee index a713fcc6c2..cbf49ccaa4 100644 --- a/cms/static/coffee/src/views/unit.coffee +++ b/cms/static/coffee/src/views/unit.coffee @@ -42,6 +42,11 @@ class CMS.Views.UnitEdit extends Backbone.View @$('.components').sortable( handle: '.drag-handle' update: (event, ui) => @model.set('children', @components()) + helper: 'clone' + opacity: '0.5' + placeholder: 'component-placeholder' + forcePlaceholderSize: true + axis: 'y' ) @$('.component').each((idx, element) => diff --git a/cms/static/sass/_unit.scss b/cms/static/sass/_unit.scss index 7323f37bfd..e0b789c39e 100644 --- a/cms/static/sass/_unit.scss +++ b/cms/static/sass/_unit.scss @@ -87,6 +87,10 @@ } } + &.component-placeholder { + border-color: #6696d7; + } + .xmodule_display { padding: 40px 20px 20px; }