absolute master dragging with shift key pressed

This commit is contained in:
jean-emmanuel 2015-10-24 14:38:28 +02:00
parent 243b84bd13
commit 075aa55f8d
4 changed files with 42 additions and 9 deletions

File diff suppressed because one or more lines are too long

View file

@ -154,12 +154,36 @@ init = function(session,callback) {
$('.inspector .result').html(data)
})
// MASTER DRAGGING (wip)
// $('body').drag(function(ev,dd){
// $(ev.target).trigger('draginit',[ev])
// })
// MASTER DRAGGING (while shift key pressed)
var target
$(document).keydown(function (e) {
if (e.keyCode == 16) {
$('body').addClass('master-dragging')
$('body').on('draginit',function(ev,dd){
$('body').removeClass('master-dragging')
})
if (callback) callback()
$('body').on('drag',function(ev,dd){
$(ev.target).trigger('draginit',[ev])
if (target!=ev.target) $(ev.target).click()
target = ev.target
})
$('body').on('dragend',function(ev,dd){
$('body').addClass('master-dragging')
})
}
});
$(document).keyup(function (e) {
if (e.keyCode == 16) {
$('body').removeClass('master-dragging')
$('body').off('draginit')
$('body').off('drag')
$('body').off('dragend')
}
});
if (callback) callback()
}

View file

@ -213,6 +213,7 @@ a.btn {
&.sidepanel-open {
right:$sidepanel-size;
}
#open-toggle {
position:absolute;
right:0;
@ -620,7 +621,15 @@ form {
}
}
.master-dragging .widget:after {
content:"";
position: absolute;
top:0;
left:0;
right:0;
bottom:0;
z-index: 999999;
}
/* STRIP (contains any widgets) */

View file

@ -12,7 +12,7 @@
{
label:false,
type:"knob",
target:target
target:target,absolute:true
},
{
label:false,
@ -24,7 +24,7 @@
label:false,
type:"fader",
range:db,
target:target,
target:target,absolute:true
},
{
label:'Mute',