Skip to content

Commit 04b2c0a

Browse files
committed
Merge pull request #202 from Soundnode/fixes
code refactoring and fix on formating song duration
2 parents 1d2566b + 6a429bc commit 04b2c0a

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

app/public/js/common/appCtrl.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
app.controller('AppCtrl', function ($rootScope, $scope, $window, $log, ngDialog, hotkeys) {
3+
app.controller('AppCtrl', function ($rootScope, $scope, $window, $log, ngDialog) {
44

55
// Settings sub nav (dropdown)
66
$scope.isSettingsVisible = false;
@@ -11,7 +11,7 @@ app.controller('AppCtrl', function ($rootScope, $scope, $window, $log, ngDialog,
1111
} else {
1212
$scope.isSettingsVisible = true;
1313
}
14-
}
14+
};
1515

1616
// check if track has Art work
1717
// otherwise replace to Soundnode App logo
@@ -28,17 +28,16 @@ app.controller('AppCtrl', function ($rootScope, $scope, $window, $log, ngDialog,
2828

2929
// Format song duration on tracks
3030
// for human reading
31-
$scope.formatSongDuration = function(duration) {
31+
$scope.formatSongDuration = function (duration) {
3232
var minutes = Math.floor(duration / 60000)
3333
, seconds = ((duration % 60000) / 1000).toFixed(0);
34-
34+
3535
return minutes + ":" + (seconds < 10 ? '0' : '') + seconds;
3636
};
3737

3838
/*
3939
* Navigation back and forward
4040
*/
41-
4241
$scope.goBack = function() {
4342
$window.history.back();
4443
};

app/public/js/system/settings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
window.settings = window.settings || {};
33

44
// App version
5-
window.settings.appVersion = '0.5.0';
5+
window.settings.appVersion = '0.5.1';

app/views/common/tracks.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ <h2 class="songList_item_song_tit">{{ data.title }}</h2>
2020

2121
<h3 class="songList_item_song_user">
2222
<a ui-sref="profile({id: {{data.user.id}}})">{{ data.user.username }}</a>
23-
<span class="songList_item_song_length"> {{ data.duration }} {{ formatSongDuration (data.duration) }}</span>
23+
<span ng-controller="AppCtrl" class="songList_item_song_length"> {{ formatSongDuration (data.duration) }}</span>
2424
</h3>
2525

2626
<div class="songList_item_song_details">

0 commit comments

Comments
 (0)