Skip to content

Commit

Permalink
fix cursor and highlight [#63 state:committed]
Browse files Browse the repository at this point in the history
  • Loading branch information
novakps committed Sep 29, 2010
1 parent bfe335d commit 3b09cf5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
4 changes: 3 additions & 1 deletion kemia/controller/plugins/atom_edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,15 @@ kemia.controller.plugins.AtomEdit.prototype.handleKeyboardShortcut = function(e)
kemia.controller.plugins.AtomEdit.prototype.handleMouseMove = function(e) {

if (this.symbol) {
// this.logger.info('handleMouseMove');
this.editorObject.getOriginalElement().style.cursor = 'default';
var target = this.editorObject.findTarget(e);
if (e.currentTarget.highlightGroup) {
e.currentTarget.highlightGroup.clear();
}

if (target instanceof kemia.model.Atom) {

this.editorObject.getOriginalElement().style.cursor = 'pointer';
if (!e.currentTarget.highlightGroup) {
e.currentTarget.highlightGroup = this.highlightAtom(target);
} else {
Expand Down
16 changes: 5 additions & 11 deletions kemia/controller/plugins/bond_edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ kemia.controller.plugins.BondEdit.prototype.handleMouseMove = function(e) {
if (e.currentTarget.highlightGroup) {
e.currentTarget.highlightGroup.clear();
}
e.currentTarget.highlightGroup = undefined;

if (target instanceof kemia.model.Atom) {
// this.editorObject.getOriginalElement().style.cursor =
// 'url("../../images/Cursor-Single-32.png"), hand';
this.editorObject.getOriginalElement().style.cursor = 'pointer';
if (!e.currentTarget.highlightGroup) {
e.currentTarget.highlightGroup = this.highlightAtom(target);
} else {
Expand All @@ -142,8 +142,7 @@ kemia.controller.plugins.BondEdit.prototype.handleMouseMove = function(e) {
}
return true;
} else if (target instanceof kemia.model.Bond) {
// this.editorObject.getOriginalElement().style.cursor =
// 'url("../../images/Cursor-Eraser-32.png"), hand';
this.editorObject.getOriginalElement().style.cursor = 'pointer';
if (!e.currentTarget.highlightGroup) {
e.currentTarget.highlightGroup = this.highlightBond(target);
} else {
Expand All @@ -152,12 +151,8 @@ kemia.controller.plugins.BondEdit.prototype.handleMouseMove = function(e) {
}
return true;
}
} else {
e.currentTarget.highlightGroup = undefined;
return false;
}
}
return false;

};

kemia.controller.plugins.BondEdit.prototype.handleMouseDown = function(e) {
Expand Down Expand Up @@ -191,7 +186,6 @@ kemia.controller.plugins.BondEdit.prototype.handleMouseDown = function(e) {
}
}
target._last_click = goog.now();

}
}
if (target == undefined && this.bond_type) {
Expand Down Expand Up @@ -304,7 +298,7 @@ kemia.controller.plugins.BondEdit.prototype.highlightAtom = function(atom,
kemia.controller.plugins.BondEdit.prototype.highlightBond = function(bond,
opt_group) {
return this.editorObject.reactionRenderer.moleculeRenderer.bondRendererFactory
.get(bond).highlightOn(bond, '#green', opt_group);
.get(bond).highlightOn(bond, 'green', opt_group);
};

/**
Expand Down

0 comments on commit 3b09cf5

Please sign in to comment.