mirror of
https://github.com/Ekokumppanit/Bicyclesim.git
synced 2026-01-26 03:04:09 +00:00
Merge branch 'master' of github.com:Ekokumppanit/Bicyclesim
This commit is contained in:
@@ -99,7 +99,7 @@
|
||||
<div class="fluid-row">
|
||||
<form>
|
||||
<legend>Asetukset</legend>
|
||||
<label>Liikekerroin. Vaikuttaa nopeuteen jolla reitillä liikutaan. Ei vaikuta nopeuslukemaan tai kuljettuun matkaan.</label>
|
||||
<label>Liikekerroin. Vaikuttaa kuljettuun matkaan mutta ei nopeuslukemaan.</label>
|
||||
<input type="text" value="{{settings.multiplier}}" id="settings_multiplier"/>
|
||||
<label>Renkaan koko, tuumia</label>
|
||||
<input type="text" value="{{settings.diameter}}" id="settings_diameter"/>
|
||||
@@ -182,6 +182,8 @@
|
||||
{{#if can_edit}}<a href="#" class="remove"><i class="icon-remove-sign"></i></a>{{/if}}
|
||||
</li>
|
||||
{{/each}}
|
||||
{{#if can_edit}}<li class="new-point"><button type="button" class="btn"><i class="icon-plus-sign"></i></button></li>{{/if}}
|
||||
{{#if can_edit}}
|
||||
<li class="actions"><button type="button" class="btn new-point"><i class="icon-plus-sign"></i> Uusi</button> <button type="button" class="btn save{{#if saved}} btn-success{{else}} btn-warning{{/if}}"><i class="icon-save"></i> Tallenna</button></li>
|
||||
{{/if}}
|
||||
</ol>
|
||||
</template>
|
||||
|
||||
@@ -156,16 +156,16 @@ a.thumbnail
|
||||
ol.points
|
||||
margin 0
|
||||
li
|
||||
font-size 0.9em
|
||||
font-size 0.85em
|
||||
border-top 1px solid #ccc
|
||||
padding 2px 0px
|
||||
list-style-position inside
|
||||
&:first-child, &.new-point
|
||||
&:first-child, &.actions
|
||||
border-top 0
|
||||
&.new-point
|
||||
&.actions
|
||||
list-style none
|
||||
span.location
|
||||
font-size 0.8em
|
||||
font-size 0.85em
|
||||
a.remove
|
||||
float right
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ function new_point(latlng) {
|
||||
add_point(latlng, num, true);
|
||||
++num;
|
||||
$('.sidebar').animate({scrollTop: $('.sidebar-inner').height()}, 'fast');
|
||||
Session.set('saved', false);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -92,6 +93,10 @@ Template.points.can_edit = function () {
|
||||
return (route && Meteor.user() && route.owner === Meteor.user()._id);
|
||||
};
|
||||
|
||||
Template.points.saved = function () {
|
||||
return Session.get('saved');
|
||||
};
|
||||
|
||||
Template.points.helpers(helpers);
|
||||
|
||||
Template.points.events({
|
||||
@@ -101,11 +106,17 @@ Template.points.events({
|
||||
'click a.remove': function () {
|
||||
Meteor.call('remove_point', this._id, function () {
|
||||
full_clear_required = true;
|
||||
Session.set('saved', false);
|
||||
});
|
||||
},
|
||||
'click .new-point button': function () {
|
||||
'click .new-point': function () {
|
||||
new_point(maps.getLatLng());
|
||||
},
|
||||
'click .save': function () {
|
||||
Meteor.call('update_route', Session.get('route'), function () {
|
||||
Session.set('saved', true);
|
||||
});
|
||||
},
|
||||
'change #points-autoadd': function (event) {
|
||||
Session.set('points-autoadd', event.currentTarget.checked);
|
||||
}
|
||||
@@ -124,6 +135,7 @@ Meteor.autorun(function () {
|
||||
if (Session.equals('page', 'edit') && Session.get('route')) {
|
||||
debug('sivu tai route vaihtui, route: ' + Session.get('route'));
|
||||
full_clear_required = true;
|
||||
Session.set('saved', true);
|
||||
|
||||
Deps.nonreactive(function () {
|
||||
var route = Routes.findOne({_id: Session.get('route')});
|
||||
|
||||
Reference in New Issue
Block a user