drag wip
This commit is contained in:
parent
b4d23ca27f
commit
7aa83c90c2
4 changed files with 36 additions and 1 deletions
|
|
@ -162,9 +162,20 @@ export default Em.Component.extend(musicControlMixin, {
|
||||||
clickSpeaker: function(){
|
clickSpeaker: function(){
|
||||||
// simulate the speaker vibration by running a CSS animation on it
|
// simulate the speaker vibration by running a CSS animation on it
|
||||||
Em.$('#beatSpeakerCenter').removeClass('pop').prop('offsetWidth', Em.$('#beatSpeakerCenter').prop('offsetWidth')).addClass('pop');
|
Em.$('#beatSpeakerCenter').removeClass('pop').prop('offsetWidth', Em.$('#beatSpeakerCenter').prop('offsetWidth')).addClass('pop');
|
||||||
|
},
|
||||||
|
audioDrop: function(){
|
||||||
|
debugger;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
dragOver: function(){
|
||||||
|
this.set('dragging', true);
|
||||||
|
},
|
||||||
|
|
||||||
|
dragLeave: function(){
|
||||||
|
this.set('dragging', false);
|
||||||
|
},
|
||||||
|
|
||||||
changePlayerControl: function(name, value, isOption){
|
changePlayerControl: function(name, value, isOption){
|
||||||
if(isOption){
|
if(isOption){
|
||||||
var options = {};
|
var options = {};
|
||||||
|
|
@ -292,6 +303,7 @@ export default Em.Component.extend(musicControlMixin, {
|
||||||
Em.$('#beatSpeakerContainer').on('mousedown', '#beatSpeakerCenter', function(event) {
|
Em.$('#beatSpeakerContainer').on('mousedown', '#beatSpeakerCenter', function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
});
|
});
|
||||||
|
// control the volume by scrolling up/down
|
||||||
Em.$('#playerArea').on('mousewheel', function(event) {
|
Em.$('#playerArea').on('mousewheel', function(event) {
|
||||||
var scrollSize = 5;
|
var scrollSize = 5;
|
||||||
|
|
||||||
|
|
@ -301,6 +313,22 @@ export default Em.Component.extend(musicControlMixin, {
|
||||||
self.send('volumeChanged', self.get('volume') + scrollSize);
|
self.send('volumeChanged', self.get('volume') + scrollSize);
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
});
|
});
|
||||||
|
// file drag and drop support
|
||||||
|
//Em.$('.dragArea').on(
|
||||||
|
// 'dragover',
|
||||||
|
// function(e) {
|
||||||
|
// console.log('dragover');
|
||||||
|
// e.preventDefault();
|
||||||
|
// e.stopPropagation();
|
||||||
|
// }
|
||||||
|
//).on(
|
||||||
|
// 'dragenter',
|
||||||
|
// function(e) {
|
||||||
|
// console.log('dragenter');
|
||||||
|
// e.preventDefault();
|
||||||
|
// e.stopPropagation();
|
||||||
|
// }
|
||||||
|
//);
|
||||||
},
|
},
|
||||||
|
|
||||||
// component clean up
|
// component clean up
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,8 @@ export default Em.Mixin.create({
|
||||||
timeElapsed: 0,
|
timeElapsed: 0,
|
||||||
timeTotal: 0,
|
timeTotal: 0,
|
||||||
|
|
||||||
|
dragging: false,
|
||||||
|
|
||||||
playQueueEmpty: Em.computed.empty('playQueue'),
|
playQueueEmpty: Em.computed.empty('playQueue'),
|
||||||
playQueueNotEmpty: Em.computed.notEmpty('playQueue'),
|
playQueueNotEmpty: Em.computed.notEmpty('playQueue'),
|
||||||
playQueueMultiple: function(){
|
playQueueMultiple: function(){
|
||||||
|
|
|
||||||
|
|
@ -585,3 +585,8 @@ md-toolbar {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
box-shadow: 5px 10px 15px 5px rgba(0, 0, 0, 0.1);
|
box-shadow: 5px 10px 15px 5px rgba(0, 0, 0, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dragHere {
|
||||||
|
background-color: white !important;
|
||||||
|
border: 5px dotted #5383ff;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@
|
||||||
class="pull-right" {{action "addAudio"}}>{{paper-icon icon="add" class="playerControllIcon" }}</span>
|
class="pull-right" {{action "addAudio"}}>{{paper-icon icon="add" class="playerControllIcon" }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="playListArea" class="cursorPointer" {{action "playListAreaAddAudio"}}>
|
<div id="playListArea" class="cursorPointer dragArea {{if dragging "dragHere"}}" {{action "playListAreaAddAudio"}}>
|
||||||
{{#if playQueueEmpty}}
|
{{#if playQueueEmpty}}
|
||||||
<div id="dragHere">Drag your music files here</div>
|
<div id="dragHere">Drag your music files here</div>
|
||||||
{{paper-icon icon="library-music"}}
|
{{paper-icon icon="library-music"}}
|
||||||
|
|
|
||||||
Reference in a new issue