mirror of
https://github.com/flynx/pWiki.git
synced 2025-12-17 08:31:38 +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__: {
|
__dom_filters__: {
|
||||||
// sortable elements...
|
// sortable elements...
|
||||||
'.sortable': function(elems){
|
'.sortable': function(elems){
|
||||||
|
var wiki = this.page
|
||||||
elems
|
elems
|
||||||
.sortable({
|
.sortable({
|
||||||
handle: ".sort-handle",
|
handle: ".sort-handle",
|
||||||
placeholder: "sort-placeholder",
|
placeholder: "sort-placeholder",
|
||||||
forcePlaceholderSize: true,
|
forcePlaceholderSize: true,
|
||||||
axis: 'y',
|
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()
|
.addTouch()
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user