Skip to content

Commit

Permalink
Fix for missing $event causing the route planner return to fail on ev…
Browse files Browse the repository at this point in the history
…ery browser that is not Chrome
  • Loading branch information
nicoverbruggen committed Jun 2, 2014
1 parent cede54b commit 699ba29
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 16 deletions.
4 changes: 2 additions & 2 deletions app/lang/nl/client.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
// New translation strings
"planNewRoute" => "Plan nieuwe route",
"searchStations" => "Zoek naar stations",
"typeToStation" => "Typ bestemming stationsnaam",
"typeFromStation" => "Typ vertrek stationsnaam",
"typeToStation" => "Typ bestemmingstation",
"typeFromStation" => "Typ vertrekstation",
"chooseDate" => "Kies uw gewenste datum",
"chooseTime" => "Kies uw gewenste tijdstip",
"confirmSearch" => "Zoek naar treinen",
Expand Down
2 changes: 1 addition & 1 deletion app/views/core/navigation.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</div>
<div class="navbar-collapse collapse navbar-right">
<ul class="nav navbar-nav">
<li><a href="{{ URL::to('route') }}" ng-click="reset()"><i class="fa fa-road fa-12"></i> {{Lang::get('client.planNewRoute')}}</a></li>
<li><a href="{{ URL::to('route') }}" ng-click="resetplanner($event)"><i class="fa fa-road fa-12"></i> {{Lang::get('client.planNewRoute')}}</a></li>
<li><a href="{{ URL::to('stations') }}"><i class="fa fa-search fa-12"></i> {{Lang::get('client.searchStations')}}</a></li>
</ul>
</div><!--/.nav-collapse -->
Expand Down
6 changes: 3 additions & 3 deletions app/views/route/planner.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div id="main">
@include('core.navigation')
<div class="container">
<div class="row routeplanner view1 well" ng-show="planning">
<div class="row routeplanner view1" ng-show="planning">
<div class="col-sm-6">
<script type="text/ng-template" id="customTemplate.html">
<a>
Expand Down Expand Up @@ -67,7 +67,7 @@
<h3>{{Lang::get('client.error')}} <strong>{{Lang::get('client.errorNoRoutes')}}</strong></h3>
<p>{{Lang::get('client.errorExplanation')}} <a href="mailto:[email protected]">{{Lang::get('client.errorMail')}}</a>.</p>
<br/>
<a href="#" ng-click="reset()" class="btn btn-danger btn-lg btn-wide"><i class="fa fa-chevron-left"></i> {{Lang::get('client.errorReturn')}}</a>
<a href="#" ng-click="resetplanner($event)" class="btn btn-danger btn-lg btn-wide"><i class="fa fa-chevron-left"></i> {{Lang::get('client.errorReturn')}}</a>
<br/>
</div>
</div>
Expand Down Expand Up @@ -168,7 +168,7 @@
<a class="btn btn-default btn-50" ng-click="latest()">{{Lang::get('client.latestRide')}} &gt;&gt;</a>
</div>
<a class="btn btn-primary btn-wide btn-lg btn-botm" ng-click="reverse()"><i class="fa fa-exchange"></i> {{Lang::get('client.reverse')}}</a>
<a class="btn btn-default btn-wide btn-lg btn-botm" ng-click="reset()"><i class="fa fa-undo"></i> {{Lang::get('client.planAnother')}}</a>
<a class="btn btn-default btn-wide btn-lg btn-botm" ng-click="resetplanner($event)"><i class="fa fa-undo"></i> {{Lang::get('client.planAnother')}}</a>
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions public/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -158,5 +158,5 @@ input.ng-invalid {
animation: bounceIn 0.7s; }

.row.routeplanner.ng-hide-remove {
-webkit-animation: bounceIn 0.7s;
animation: bounceIn 0.7s; }
-webkit-animation: fadeInDown 0.7s;
animation: fadeInDown 0.7s; }
4 changes: 2 additions & 2 deletions public/css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,6 @@ input.ng-invalid {
}

.row.routeplanner.ng-hide-remove {
-webkit-animation: bounceIn 0.7s;
animation: bounceIn 0.7s;
-webkit-animation: fadeInDown 0.7s;
animation: fadeInDown 0.7s;
}
11 changes: 5 additions & 6 deletions public/js/irailapp/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
* @param string
*/
$scope.findStationById = function(suppliedIdentifierString){
console.log($scope.stations);
for (var i = 0, len = $scope.stations.stations.length; i < len; i++) {
if (($scope.stations.stations[i].id.toLowerCase()).indexOf(suppliedIdentifierString) != -1){
return $scope.stations.stations[i];
Expand Down Expand Up @@ -158,9 +157,9 @@
/**
* Resets the route planner to default values
*/
$scope.reset = function(){
event.stopPropagation();
event.preventDefault();
$scope.resetplanner = function(e){
e.stopPropagation();
e.preventDefault();
$scope.error = false;
$scope.loading = false;
$scope.results = false;
Expand Down Expand Up @@ -251,7 +250,7 @@
$scope.stations = data;
});

$scope.reset = function(){
$scope.resetplanner = function(){
// Should not do anything
}
});
Expand Down Expand Up @@ -292,7 +291,7 @@
}
};

$scope.reset = function(){
$scope.resetplanner = function(){
// Should not do anything
}

Expand Down

0 comments on commit 699ba29

Please sign in to comment.