I am working on a rotatable plugin for gwtquery. The idea is to create a seating chart app for teacher. Any how I can now get an element to rotate if as long as its not draggable.
What the plugin does is appends a child and makes the child draggable and uses the x and y from screen to get atan2 radians from a center point ... the parent's center point. If the parent is constantly moving then the ceterpoint isn't fixed and thus no rotation.
I've tried the following to trying and disable the parent but to no avail
private final DragFunction start = new DragFunction(){
@Override
public void f(DragContext context) {
//check to see if parent is draggable
DraggableOptions disable = new DraggableOptions();
disable.setDisabled(true);
$(context.getDraggable()).css($$("background-color:Magenta"));
$(context.getDraggable()).parent().css($$("border: 3px solid Magenta"));
//The parent's border indeed turned magenta
//but the draggable parent was not disable :{
$(context.getDraggable()).parent().as(Draggable).options(disable);
$(document).on("mousemove.rotatable", new Function(){
@Override
public boolean f(Event e){
e.stopPropagation();
e.preventDefault();
mouseCoords = new Point( e.getScreenX(), e.getScreenY());
angle = radToDeg(getAngle(mouseCoords, centerCoords));
rotate(angle);
rotating = true;
return true;
}
});
};// end start
};
Any help at all is greatly appreciated