mirror of
https://github.com/flynx/pWiki.git
synced 2025-12-17 00:21:40 +00:00
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:
parent
57928d2f46
commit
c0bdb4e604
16
pwiki.js
16
pwiki.js
@ -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()
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user