Browse Source

Allow customization of tooltip delay.

css_transitions
Tim Pettersen 10 years ago
parent
commit
8741e4d2e8
4 changed files with 31 additions and 8 deletions
  1. +1
    -0
      .gitignore
  2. +13
    -2
      dist/vis.js
  3. +4
    -4
      dist/vis.min.js
  4. +13
    -2
      src/graph/Graph.js

+ 1
- 0
.gitignore View File

@ -1,4 +1,5 @@
.idea
*.iml
node_modules
.project
.settings/.jsdtscope

+ 13
- 2
dist/vis.js View File

@ -16170,7 +16170,10 @@ function Graph (container, data, options) {
smoothCurves: true,
maxVelocity: 10,
minVelocity: 0.1, // px/s
stabilizationIterations: 1000 // maximum number of iteration to stabilize
stabilizationIterations: 1000, // maximum number of iteration to stabilize
tooltip: {
delay: 300
}
};
this.editMode = this.constants.dataManipulation.initiallyVisible;
@ -16667,6 +16670,14 @@ Graph.prototype.setOptions = function (options) {
}
}
}
if (options.tooltip) {
for (prop in options.tooltip) {
if (options.tooltip.hasOwnProperty(prop)) {
this.constants.tooltip[prop] = options.tooltip[prop];
}
}
}
}
@ -17110,7 +17121,7 @@ Graph.prototype._onMouseMoveTitle = function (event) {
clearInterval(this.popupTimer); // stop any running calculationTimer
}
if (!this.drag.dragging) {
this.popupTimer = setTimeout(checkShow, 300);
this.popupTimer = setTimeout(checkShow, this.constants.tooltip.delay);
}
};

+ 4
- 4
dist/vis.min.js
File diff suppressed because it is too large
View File


+ 13
- 2
src/graph/Graph.js View File

@ -151,7 +151,10 @@ function Graph (container, data, options) {
smoothCurves: true,
maxVelocity: 10,
minVelocity: 0.1, // px/s
stabilizationIterations: 1000 // maximum number of iteration to stabilize
stabilizationIterations: 1000, // maximum number of iteration to stabilize
tooltip: {
delay: 300
}
};
this.editMode = this.constants.dataManipulation.initiallyVisible;
@ -648,6 +651,14 @@ Graph.prototype.setOptions = function (options) {
}
}
}
if (options.tooltip) {
for (prop in options.tooltip) {
if (options.tooltip.hasOwnProperty(prop)) {
this.constants.tooltip[prop] = options.tooltip[prop];
}
}
}
}
@ -1091,7 +1102,7 @@ Graph.prototype._onMouseMoveTitle = function (event) {
clearInterval(this.popupTimer); // stop any running calculationTimer
}
if (!this.drag.dragging) {
this.popupTimer = setTimeout(checkShow, 300);
this.popupTimer = setTimeout(checkShow, this.constants.tooltip.delay);
}
};

Loading…
Cancel
Save