Commit 523cb334 by Victor Shnayder

Hook up reordering children in the browser.

* NOTE: the new order is NOT saved to the server!
parent 77175872
......@@ -13,6 +13,16 @@ class CMS.Views.ModuleEdit extends Backbone.View
# Load preview modules
XModule.loadModules('display')
@enableDrag()
enableDrag: ->
# Enable dragging things in the #sortable div (if there is one)
if $("#sortable").length > 0
$("#sortable").sortable({
placeholder: "ui-state-highlight"
})
$("#sortable").disableSelection();
save: (event) ->
event.preventDefault()
......@@ -32,6 +42,7 @@ class CMS.Views.ModuleEdit extends Backbone.View
cancel: (event) ->
event.preventDefault()
CMS.popView()
@enableDrag()
editSubmodule: (event) ->
event.preventDefault()
......@@ -42,3 +53,4 @@ class CMS.Views.ModuleEdit extends Backbone.View
id: $(event.target).data('id')
type: if moduleType == 'None' then null else moduleType
previewType: if previewType == 'None' then null else previewType
@enableDrag()
......@@ -33,7 +33,7 @@
<section class="modules">
<ol>
<li>
<ol>
<ol id="sortable">
% for child in module.get_children():
<li class="${module.category}">
<a href="#" class="module-edit"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment