mirror of
https://github.com/Ekokumppanit/Lentolaskuri.git
synced 2026-01-26 11:13:58 +00:00
23 lines
443 B
JavaScript
23 lines
443 B
JavaScript
define([
|
|
'backbone',
|
|
'select2'
|
|
], function (Backbone) {
|
|
var Dropdown = Backbone.View.extend({
|
|
events: {
|
|
'change': 'change'
|
|
},
|
|
initialize: function (opts) {
|
|
this.$el.select2(opts.select2);
|
|
},
|
|
open: function () {
|
|
this.$el.select2('open');
|
|
},
|
|
change: function () {
|
|
this.trigger('new-leg', this.$el.select2('data'));
|
|
this.$el.select2('data', {});
|
|
}
|
|
});
|
|
|
|
return Dropdown;
|
|
});
|