master drag now starts on mousedown
fader pips visible on low zoom
This commit is contained in:
parent
2375d27052
commit
8a385079c6
5 changed files with 52 additions and 21 deletions
File diff suppressed because one or more lines are too long
|
|
@ -157,20 +157,18 @@ init = function(session,callback) {
|
|||
|
||||
$(document).keydown(function (e) {
|
||||
if (e.keyCode == 16) {
|
||||
$('body').addClass('master-dragging')
|
||||
$('body').on('draginit',function(ev,dd){
|
||||
$('body').removeClass('master-dragging')
|
||||
})
|
||||
// $('body').addClass('master-dragging')
|
||||
|
||||
$('body').on('drag',function(ev,dd){
|
||||
dd.absolute=true
|
||||
dd.shiftKey=false
|
||||
$(dd.target).trigger('draginit',[dd])
|
||||
if (target!=dd.target) $(dd.target).click()
|
||||
target = dd.target
|
||||
|
||||
})
|
||||
$('body').on('dragend',function(ev,dd){
|
||||
$('body').addClass('master-dragging')
|
||||
// $('body').addClass('master-dragging')
|
||||
})
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ createWidget.xy = function(widgetData) {
|
|||
|
||||
var off = {x:0,y:0}
|
||||
pad.on('draginit',function(e,data){
|
||||
if (absolute || data.absolute || data.ctrlKey) {
|
||||
if (absolute || data.absolute || data.ctrlKey || data.shiftKey) {
|
||||
var h = ((pad.height-data.offsetY) * 100 / pad.height),
|
||||
w = (data.offsetX * 100 / pad.width)
|
||||
handle[0].setAttribute('style','height:'+h+'%;width:'+w+'%')
|
||||
|
|
@ -216,6 +216,8 @@ createWidget.xy = function(widgetData) {
|
|||
|
||||
})
|
||||
pad.on('drag',function(e,data){
|
||||
if (data.shiftKey) return
|
||||
|
||||
var h = clip((-data.deltaY)*100/pad.height+off.y,[0,100]),
|
||||
w = clip((data.deltaX)*100/pad.width+off.x,[0,100])
|
||||
handle[0].setAttribute('style','height:'+h+'%;width:'+w+'%')
|
||||
|
|
@ -341,7 +343,7 @@ createWidget.rgb = function(widgetData) {
|
|||
|
||||
var rgbOff = {x:0,y:0}
|
||||
pad.on('draginit',function(e,data){
|
||||
if (absolute || data.absolute || data.ctrlKey) {
|
||||
if (absolute || data.absolute || data.ctrlKey || data.shiftKey) {
|
||||
var h = ((pad.height-data.offsetY) * 100 / pad.height),
|
||||
w = (data.offsetX * 100 / pad.width)
|
||||
rgbHandle[0].setAttribute('style','height:'+h+'%;width:'+w+'%')
|
||||
|
|
@ -359,6 +361,8 @@ createWidget.rgb = function(widgetData) {
|
|||
|
||||
})
|
||||
pad.on('drag',function(e,data){
|
||||
if (data.shiftKey) return
|
||||
|
||||
var h = clip((-data.deltaY)*100/pad.height+rgbOff.y,[0,100]),
|
||||
w = clip(data.deltaX*100/pad.width+rgbOff.x,[0,100])
|
||||
rgbHandle[0].setAttribute('style','height:'+h+'%;width:'+w+'%')
|
||||
|
|
@ -376,7 +380,7 @@ createWidget.rgb = function(widgetData) {
|
|||
|
||||
var hueOff = 0
|
||||
huePad.on('draginit',function(e,data){
|
||||
if (absolute || data.absolute || data.ctrlKey) {
|
||||
if (absolute || data.absolute || data.ctrlKey || data.shiftKey) {
|
||||
var d = (data.offsetX * 100 / pad.width)
|
||||
hueHandle[0].setAttribute('style','width:'+d+'%')
|
||||
hueHandle.width = d
|
||||
|
|
@ -402,6 +406,9 @@ createWidget.rgb = function(widgetData) {
|
|||
|
||||
|
||||
huePad.on('drag',function(e,data){
|
||||
|
||||
if (data.shiftKey) return
|
||||
|
||||
var w = clip(data.deltaX*100/pad.width+hueOff,[0,100])
|
||||
hueHandle[0].setAttribute('style','width:'+w+'%')
|
||||
hueHandle.width = w
|
||||
|
|
@ -557,7 +564,7 @@ createWidget.fader = function(widgetData,container){
|
|||
var off = 0
|
||||
|
||||
wrapper.on('draginit',function(e,data){
|
||||
if (absolute || data.absolute || data.ctrlKey) {
|
||||
if (absolute || data.absolute || data.ctrlKey || data.shiftKey) {
|
||||
var d = (dimension=='height')?
|
||||
((fader.size-data.offsetY+(wrapper.size-fader.size)/2) * 100 / fader.size):
|
||||
(data.offsetX - (wrapper.size-fader.size)/2) * 100 / fader.size
|
||||
|
|
@ -578,16 +585,19 @@ createWidget.fader = function(widgetData,container){
|
|||
|
||||
|
||||
wrapper.on('drag',function(e,data){
|
||||
var d = (dimension=='height')?-data.deltaY:data.deltaX
|
||||
d = clip(d*100/fader.size+off,[0,100])
|
||||
handle[0].setAttribute('style',dimension+':'+d+'%')
|
||||
handle.size = d
|
||||
|
||||
var v = widget.getValue()
|
||||
widget.sendValue(v)
|
||||
widget.showValue(v)
|
||||
if (data.shiftKey) return
|
||||
|
||||
widget.trigger('sync')
|
||||
var d = (dimension=='height')?-data.deltaY:data.deltaX
|
||||
d = clip(d*100/fader.size+off,[0,100])
|
||||
handle[0].setAttribute('style',dimension+':'+d+'%')
|
||||
handle.size = d
|
||||
|
||||
var v = widget.getValue()
|
||||
widget.sendValue(v)
|
||||
widget.showValue(v)
|
||||
|
||||
widget.trigger('sync')
|
||||
|
||||
})
|
||||
|
||||
|
|
@ -717,7 +727,7 @@ createWidget.knob = function(widgetData) {
|
|||
offY = 0
|
||||
wrapper.on('draginit',function(e,data){
|
||||
|
||||
if (absolute || data.absolute || data.ctrlKey) {
|
||||
if (absolute || data.absolute || data.ctrlKey || data.shiftKey) {
|
||||
var w = data.target.clientWidth,
|
||||
h = data.target.clientHeight,
|
||||
x = data.offsetX-w/2,
|
||||
|
|
@ -755,9 +765,11 @@ createWidget.knob = function(widgetData) {
|
|||
|
||||
wrapper.on('drag',function(e,data){
|
||||
|
||||
if (data.shiftKey) return
|
||||
|
||||
var r = clip(-data.deltaY*2+offR,[0,270])
|
||||
|
||||
if (absolute || data.absolute || data.ctrlKey) {
|
||||
if (absolute || data.absolute || data.ctrlKey || data.shiftKey) {
|
||||
var w = data.target.clientWidth,
|
||||
h = data.target.clientHeight,
|
||||
x = data.deltaX + offX,
|
||||
|
|
|
|||
|
|
@ -1099,7 +1099,7 @@ form {
|
|||
.pip {
|
||||
height:1%;
|
||||
width:4rem;
|
||||
border-bottom:1rem solid $color-text;
|
||||
border-bottom:1px solid $color-text;
|
||||
&.val {
|
||||
width:10rem;
|
||||
position: relative;
|
||||
|
|
|
|||
|
|
@ -57,7 +57,28 @@ dialog.showErrorBox = function(title,err) {
|
|||
}
|
||||
|
||||
|
||||
var x = require('express')(),
|
||||
path = require('path')
|
||||
|
||||
x.get('/', function(req, res){
|
||||
res.sendfile(path.resolve(__dirname + '/../browser/index.html'));
|
||||
});
|
||||
|
||||
x.get('*', function(req, res){
|
||||
res.sendfile(path.resolve(__dirname + '/../browser'+req.path));
|
||||
});
|
||||
|
||||
x.listen(3000);
|
||||
|
||||
|
||||
var jsdom = require("jsdom");
|
||||
var w = jsdom.jsdom().defaultView;
|
||||
|
||||
jsdom.jQueryify(w, "http://code.jquery.com/jquery-2.1.1.js", function () {
|
||||
w.$("body").append('<div class="testing">Hello World, It works</div>');
|
||||
|
||||
console.log(w.$(".testing").text());
|
||||
});
|
||||
|
||||
|
||||
restartApp = function(){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue