mirror of
https://github.com/Ekokumppanit/Lentolaskuri.git
synced 2026-01-26 11:13:58 +00:00
23 lines
514 B
JavaScript
23 lines
514 B
JavaScript
'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;
|
|
});
|