mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
* Added new message count * Added route change for group plan * Added fix for quest value of 0 * Fixed guild summary limit, guild and challenge height * Added task sorting * Added api buy armoire * Fixed linting
24 lines
509 B
JavaScript
24 lines
509 B
JavaScript
import Sortable from 'sortablejs';
|
|
|
|
let emit = (vnode, eventName, data) => {
|
|
let handlers = vnode.data && vnode.data.on ||
|
|
vnode.componentOptions && vnode.componentOptions.listeners;
|
|
|
|
if (handlers && handlers[eventName]) {
|
|
handlers[eventName].fns(data);
|
|
}
|
|
};
|
|
|
|
export default {
|
|
bind (el, binding, vnode) {
|
|
Sortable.create(el, {
|
|
onSort: (evt) => {
|
|
emit(vnode, 'onsort', {
|
|
oldIndex: evt.oldIndex,
|
|
newIndex: evt.newIndex,
|
|
});
|
|
},
|
|
});
|
|
},
|
|
};
|