added manual sorting, still need to mix with aout sort...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-10-11 22:38:50 +03:00
parent 57928d2f46
commit c0bdb4e604

View File

@ -1344,12 +1344,28 @@ var pWikiUIActions = actions.Actions({
__dom_filters__: {
// sortable elements...
'.sortable': function(elems){
var wiki = this.page
elems
.sortable({
handle: ".sort-handle",
placeholder: "sort-placeholder",
forcePlaceholderSize: true,
axis: 'y',
update: function(evt, ui){
// get item list...
var order = ui.item
.parent().children('macro[src]')
.map(function(){ return $(this).attr('src') })
.toArray()
// save the order...
// XXX need to mix this with .sort(..)
wiki
.get(order[0] + '/../*')
.order(['*'].concat(order))
.order('save')
},
})
.addTouch()
},