mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2025-02-18 02:54:21 +01:00
Fixed sidebar not animating sometimes
This commit is contained in:
parent
4e564aed0c
commit
e10c08ce87
1 changed files with 19 additions and 6 deletions
|
@ -15,8 +15,8 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
module.exports = angular.module('ponyfm').controller "sidebar", [
|
module.exports = angular.module('ponyfm').controller "sidebar", [
|
||||||
'$scope', '$modal', 'playlists', '$rootScope'
|
'$scope', '$modal', 'playlists', '$rootScope', '$timeout'
|
||||||
($scope, $modal, playlists, $rootScope) ->
|
($scope, $modal, playlists, $rootScope, $timeout) ->
|
||||||
$scope.playlists = playlists.pinnedPlaylists
|
$scope.playlists = playlists.pinnedPlaylists
|
||||||
$scope.menuVisible = false
|
$scope.menuVisible = false
|
||||||
$scope.menuActive = false
|
$scope.menuActive = false
|
||||||
|
@ -24,13 +24,25 @@ module.exports = angular.module('ponyfm').controller "sidebar", [
|
||||||
$scope.navStyle = {}
|
$scope.navStyle = {}
|
||||||
|
|
||||||
$rootScope.$on('sidebarToggled', () ->
|
$rootScope.$on('sidebarToggled', () ->
|
||||||
$scope.menuVisible = !$scope.menuVisible
|
$timeout(() ->
|
||||||
$scope.menuActive = $scope.menuVisible
|
if $scope.menuVisible
|
||||||
|
$scope.navStyle.transform = ''
|
||||||
|
$scope.menuAnimated = true
|
||||||
|
|
||||||
|
$scope.menuVisible = !$scope.menuVisible
|
||||||
|
$scope.menuActive = $scope.menuVisible
|
||||||
|
|
||||||
|
console.log $scope.menuActive
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
$rootScope.$on('sidebarHide', () ->
|
$rootScope.$on('sidebarHide', () ->
|
||||||
$scope.menuVisible = false
|
$timeout(() ->
|
||||||
$scope.menuActive = false
|
$scope.navStyle.transform = ''
|
||||||
|
$scope.menuAnimated = true
|
||||||
|
$scope.menuVisible = false
|
||||||
|
$scope.menuActive = false
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
$scope.createPlaylist = () ->
|
$scope.createPlaylist = () ->
|
||||||
|
@ -78,6 +90,7 @@ module.exports = angular.module('ponyfm').controller "sidebar", [
|
||||||
touchingNav = false
|
touchingNav = false
|
||||||
|
|
||||||
onStart = (e) ->
|
onStart = (e) ->
|
||||||
|
|
||||||
if !$scope.menuVisible
|
if !$scope.menuVisible
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue