adjust volume with mousewheel (#131)

This commit is contained in:
HanQing 2018-02-28 21:36:20 +08:00 committed by Listen 1
parent 3097bb6fa9
commit 4ea3a1cf9d
2 changed files with 10 additions and 1 deletions

View File

@ -641,6 +641,14 @@
};
});
app.directive('volumeWheel', function() {
return function (scope, element, attrs) {
element.bind('mousewheel', function(){
scope.adjustVolume(window.event.wheelDelta>0)
});
};
});
app.controller('PlayController', ['$scope', '$timeout','$log',
'$anchorScroll', '$location', 'angularPlayer', '$http',
'$httpParamSerializerJQLike','$rootScope', 'Notification',
@ -659,6 +667,7 @@
$scope.scrobbleTrackId = null;
$scope.scrobbleTimer = new Timer();
$scope.adjustVolume = angularPlayer.adjustVolume;
function switchMode(mode){
//playmode 0:loop 1:shuffle 2:repeat one

View File

@ -475,7 +475,7 @@
<a class="icn icn-list" title="列表(l)" ng-click="togglePlaylist()"></a>
</div>
<div class="volume-ctrl">
<div class="volume-ctrl" volume-wheel>
<a class="icn" ng-class="{ 'icn-vol-mute': mute, 'icn-vol': mute == false }" title="静音(m) 增大(u) 减少(d)" ng-click="toggleMuteStatus()"></a>
<div class="m-pbar volume" >
<div class="barbg" id="volumebar" mode="volume" draggable>