Last active
December 3, 2015 11:57
-
-
Save krzystof/08e0c40e1e2f47cb4910 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
Object.defineProperty(exports, '__esModule', { | |
value: true | |
}); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | |
var _sortablejs = require('sortablejs'); | |
var _sortablejs2 = _interopRequireDefault(_sortablejs); | |
exports['default'] = { | |
params: ['options', 'eventName'], | |
bind: function bind() { | |
var self = this; | |
this.params.options.onUpdate = function () { | |
self.update(this.toArray()); | |
}, this.sortable = _sortablejs2['default'].create(this.el, this.params.options); | |
}, | |
update: function update(val) { | |
if (typeof val === 'undefined') { | |
return; | |
} | |
this.vm.$emit(this.params.eventName, val); | |
}, | |
unbind: function unbind() { | |
this.sortable.destroy(); | |
} | |
}; | |
module.exports = exports['default']; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment