mirror of
https://github.com/Ekokumppanit/Lentolaskuri.git
synced 2026-02-19 19:49:09 +00:00
Initial commit
This commit is contained in:
22
app/scripts/views/roundtrip.js
Normal file
22
app/scripts/views/roundtrip.js
Normal file
@@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
define([
|
||||
'backbone',
|
||||
'backbone-mediator'
|
||||
], function (Backbone) {
|
||||
var RoundtripInput = Backbone.View.extend({
|
||||
el: '.roundtripWidget',
|
||||
events: {
|
||||
'click button': 'click'
|
||||
},
|
||||
click: function (event, el) {
|
||||
this.$el.find('button').removeClass('active');
|
||||
var current = this.$el.find(event.currentTarget);
|
||||
current.addClass('active');
|
||||
|
||||
Backbone.Mediator.publish('roundtrip:change', current.hasClass('roundtrip'));
|
||||
}
|
||||
});
|
||||
|
||||
return RoundtripInput;
|
||||
});
|
||||
Reference in New Issue
Block a user