small modifications for space module
This commit is contained in:
parent
ff9f15535c
commit
7148a53dc8
|
@ -76,16 +76,18 @@
|
||||||
cover.append(dragBox);
|
cover.append(dragBox);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
cover.on("mousemove",function(e){
|
cover.on("mousemove",function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if(isDragging){
|
if(isDragging){
|
||||||
diffX = e.offsetX - offsetX;
|
diffX = e.offsetX - offsetX;
|
||||||
diffY = e.offsetY - offsetY;
|
diffY = e.offsetY - offsetY;
|
||||||
currentDragBox.css({
|
if(diffX > 0 && diffY > 0){
|
||||||
width : diffX + "px",
|
console.log(diffX,diffY);
|
||||||
height : diffY + "px"
|
currentDragBox.css({
|
||||||
})
|
width : diffX + "px",
|
||||||
|
height : diffY + "px"
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -97,6 +99,7 @@
|
||||||
btn = $("<button class='make-box-permanent btn-flat btn-flat-has-icon btn-flat-primary btn-flat-small absolute-center'><i class='fa fa-check'></i>OK</button>");
|
btn = $("<button class='make-box-permanent btn-flat btn-flat-has-icon btn-flat-primary btn-flat-small absolute-center'><i class='fa fa-check'></i>OK</button>");
|
||||||
btn.on("click",selectAreaOkBtnHandler);
|
btn.on("click",selectAreaOkBtnHandler);
|
||||||
currentDragBox.append(btn);
|
currentDragBox.append(btn);
|
||||||
|
currentDragBox.addClass("hover");
|
||||||
currentDragBox.hover(function(){
|
currentDragBox.hover(function(){
|
||||||
$(this).addClass("hover");
|
$(this).addClass("hover");
|
||||||
},function(){
|
},function(){
|
||||||
|
|
|
@ -88,24 +88,17 @@
|
||||||
cover.append(dragBox);
|
cover.append(dragBox);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
var tempX = 0,
|
|
||||||
tempY = 0;
|
|
||||||
cover.on("mousemove",function(e){
|
cover.on("mousemove",function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if(isDragging){
|
if(isDragging){
|
||||||
diffX = e.offsetX - offsetX;
|
diffX = e.offsetX - offsetX;
|
||||||
diffY = e.offsetY - offsetY;
|
diffY = e.offsetY - offsetY;
|
||||||
if(diffX > 0 && diffY > 0){
|
if(diffX > 0 && diffY > 0){
|
||||||
console.log("Difference :", diffX, diffY);
|
console.log(diffX,diffY);
|
||||||
console.log("Old :", tempX, tempY);
|
currentDragBox.css({
|
||||||
tempX = diffX;
|
width : diffX + "px",
|
||||||
tempY = diffY;
|
height : diffY + "px"
|
||||||
if(diffX >= tempX && diffY >= tempY){
|
})
|
||||||
currentDragBox.css({
|
|
||||||
width : diffX + "px",
|
|
||||||
height : diffY + "px"
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -123,6 +116,7 @@
|
||||||
btn = $("<button class='make-box-permanent btn-flat btn-flat-has-icon btn-flat-primary btn-flat-small absolute-center'><i class='fa fa-check'></i>OK</button>");
|
btn = $("<button class='make-box-permanent btn-flat btn-flat-has-icon btn-flat-primary btn-flat-small absolute-center'><i class='fa fa-check'></i>OK</button>");
|
||||||
btn.on("click",selectAreaOkBtnHandler);
|
btn.on("click",selectAreaOkBtnHandler);
|
||||||
currentDragBox.append(btn);
|
currentDragBox.append(btn);
|
||||||
|
currentDragBox.addClass("hover");
|
||||||
currentDragBox.hover(function(){
|
currentDragBox.hover(function(){
|
||||||
$(this).addClass("hover");
|
$(this).addClass("hover");
|
||||||
},function(){
|
},function(){
|
||||||
|
|
Loading…
Reference in New Issue