Hook up reordering children in the browser.
* NOTE: the new order is NOT saved to the server!
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user