mirror of
https://github.com/Ekokumppanit/Lentolaskuri.git
synced 2026-02-13 16:46:56 +00:00
Initial commit
This commit is contained in:
22
app/scripts/views/dropdown.js
Normal file
22
app/scripts/views/dropdown.js
Normal file
@@ -0,0 +1,22 @@
|
||||
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;
|
||||
});
|
||||
Reference in New Issue
Block a user