Skip to content
Permalink
Browse files

factor out mouse[out|over]_of_huviz_controls

  • Loading branch information
smurp committed Feb 14, 2020
1 parent c140075 commit 67df6ff5fe4b33692927d911e54b12831b7be17b
Showing with 26 additions and 20 deletions.
  1. +14 −12 lib/huviz.js
  2. +12 −8 src/huviz.coffee
@@ -7394,18 +7394,18 @@ OnceRunner.prototype.makeWrapper = function(callback) {

Huviz.prototype.install_update_pointer_togglers = function() {
console.warn("the update_pointer_togglers are being called too often");
d3.select("#huvis_controls").on("mouseover", (function(_this) {
return function() {
_this.update_pointer = false;
return _this.text_cursor.pause("default");
};
})(this));
return d3.select("#huvis_controls").on("mouseout", (function(_this) {
return function() {
_this.update_pointer = true;
return _this.text_cursor["continue"]();
};
})(this));
d3.select("#huvis_controls").on("mouseout", this.mouseout_of_huviz_controls);
return d3.select("#huvis_controls").on("mouseover", this.mouseover_of_huviz_controls);
};

Huviz.prototype.mouseout_of_huviz_controls = function() {
this.update_pointer = true;
this.text_cursor["continue"]();
};

Huviz.prototype.mouseover_of_huviz_controls = function() {
this.update_pointer = false;
this.text_cursor.pause("default");
};

Huviz.prototype.DEPRECATED_adjust_cursor = function() {
@@ -13717,6 +13717,8 @@ OnceRunner.prototype.makeWrapper = function(callback) {
this.discovery_triple_ingestor_N3 = bind(this.discovery_triple_ingestor_N3, this);
this.hide_state_msg = bind(this.hide_state_msg, this);
this.tick = bind(this.tick, this);
this.mouseover_of_huviz_controls = bind(this.mouseover_of_huviz_controls, this);
this.mouseout_of_huviz_controls = bind(this.mouseout_of_huviz_controls, this);
this.get_gravity = bind(this.get_gravity, this);
this.get_charge = bind(this.get_charge, this);
this.updateWindow = bind(this.updateWindow, this);
@@ -2021,14 +2021,18 @@ class Huviz

install_update_pointer_togglers: ->
console.warn("the update_pointer_togglers are being called too often")
d3.select("#huvis_controls").on "mouseover", () =>
@update_pointer = false
@text_cursor.pause("default")
#console.log "update_pointer: #{@update_pointer}"
d3.select("#huvis_controls").on "mouseout", () =>
@update_pointer = true
@text_cursor.continue()
#console.log "update_pointer: #{@update_pointer}"
d3.select("#huvis_controls").on("mouseout", @mouseout_of_huviz_controls)
d3.select("#huvis_controls").on("mouseover", @mouseover_of_huviz_controls)

mouseout_of_huviz_controls: =>
@update_pointer = true
@text_cursor.continue()
return

mouseover_of_huviz_controls: =>
@update_pointer = false
@text_cursor.pause("default")
return

DEPRECATED_adjust_cursor: ->
# http://css-tricks.com/almanac/properties/c/cursor/

0 comments on commit 67df6ff

Please sign in to comment.
You can’t perform that action at this time.