Skip to content

Commit

Permalink
Changed WhiteboardPaper.cursor.cursor to cursorDOM
Browse files Browse the repository at this point in the history
Resolves #2955
  • Loading branch information
OZhurbenko committed Feb 1, 2016
1 parent d0112ff commit b19f227
Showing 1 changed file with 15 additions and 15 deletions.
Expand Up @@ -18,55 +18,55 @@ this.WhiteboardCursorModel = (function() {
if(this.color == null) {
this.color = "#ff6666"; // a pinkish red
}
this.cursor = null;
this.cursorDOM = null;
}

draw() {
this.cursor = this.paper.circle(0, 0, this.radius);
this.cursor.attr({
this.cursorDOM = this.paper.circle(0, 0, this.radius);
this.cursorDOM.attr({
"fill": this.color,
"stroke": this.color,
"opacity": "0.8"
});
return $(this.cursor.node).on("mousewheel", _.bind(this._onMouseWheel, this));
return $(this.cursorDOM.node).on("mousewheel", _.bind(this._onMouseWheel, this));
}

toFront() {
if(this.cursor != null) {
return this.cursor.toFront();
if(this.cursorDOM != null) {
return this.cursorDOM.toFront();
}
}

setRadius(value) {
if(this.cursor != null) {
return this.cursor.attr({
if(this.cursorDOM != null) {
return this.cursorDOM.attr({
r: value
});
}
}

setPosition(x, y) {
if(this.cursor != null) {
return this.cursor.attr({
if(this.cursorDOM != null) {
return this.cursorDOM.attr({
cx: x,
cy: y
});
}
}

undrag() {
if(this.cursor != null) {
return this.cursor.undrag();
if(this.cursorDOM != null) {
return this.cursorDOM.undrag();
}
}

drag(onMove, onStart, onEnd, target) {
if(target == null) {
target = null;
}
if(this.cursor != null) {
if(this.cursorDOM != null) {
target || (target = this);
return this.cursor.drag(_.bind(onMove, target), _.bind(onStart, target), _.bind(onEnd, target));
return this.cursorDOM.drag(_.bind(onMove, target), _.bind(onStart, target), _.bind(onEnd, target));
}
}

Expand All @@ -75,7 +75,7 @@ this.WhiteboardCursorModel = (function() {
}

remove() {
return this.cursor.remove();
return this.cursorDOM.remove();
}
}

Expand Down

0 comments on commit b19f227

Please sign in to comment.