added auto-grouping...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-02-08 02:51:40 +03:00
parent fd4b663c1e
commit 277f5c25e5

View File

@ -778,11 +778,17 @@ function(list, options){
buttons = options.buttons = buttons = options.buttons =
buttons buttons
.map(function(button){ .map(function(button){
return button in __buttons ? var res = button in __buttons ?
__buttons[button] __buttons[button]
: button[1] in __buttons ? : button[1] in __buttons ?
[button[0], __buttons[button[1]][1]] [button[0], __buttons[button[1]][1]]
: button.slice() }) : button.slice()
// group if at least one sort button is present...
if(res !== button){
options.groupList = true
}
return res
})
// clear out the unused button placeholders... // clear out the unused button placeholders...
.filter(function(b){ .filter(function(b){
return ['UP', 'DOWN', 'TO_TOP', 'TO_BOTTOM', 'REMOVE'].indexOf(b) < 0 }) return ['UP', 'DOWN', 'TO_TOP', 'TO_BOTTOM', 'REMOVE'].indexOf(b) < 0 })