Browse Source

- When hovering over a node that does not have a title, the title of one of the connected edges that HAS a title is no longer shown.

v3_develop
Alex de Mulder 10 years ago
parent
commit
9f29b0ad57
4 changed files with 3322 additions and 3311 deletions
  1. +1
    -0
      HISTORY.md
  2. +3310
    -3305
      dist/vis.js
  3. +2
    -2
      examples/network/03_images.html
  4. +9
    -4
      lib/network/Network.js

+ 1
- 0
HISTORY.md View File

@ -18,6 +18,7 @@ http://visjs.org
- Changed group behaviour, groups now extend the options, not replace. This allows partial defines of color. - Changed group behaviour, groups now extend the options, not replace. This allows partial defines of color.
- Fixed bug where box shaped nodes did not use hover color. - Fixed bug where box shaped nodes did not use hover color.
- Fixed Locales docs. - Fixed Locales docs.
- When hovering over a node that does not have a title, the title of one of the connected edges that HAS a title is no longer shown.
### Graph2d ### Graph2d

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


+ 2
- 2
examples/network/03_images.html View File

@ -34,10 +34,10 @@
// Create a data table with links. // Create a data table with links.
edges = []; edges = [];
nodes.push({id: 1, label: 'Main', image: DIR + 'Network-Pipe-icon.png', shape: 'image'});
nodes.push({id: 1, label: 'Main', image: DIR + 'Network-Pipe-icon.png', shape: 'image'});
nodes.push({id: 2, label: 'Office', image: DIR + 'Network-Pipe-icon.png', shape: 'image'}); nodes.push({id: 2, label: 'Office', image: DIR + 'Network-Pipe-icon.png', shape: 'image'});
nodes.push({id: 3, label: 'Wireless', image: DIR + 'Network-Pipe-icon.png', shape: 'image'}); nodes.push({id: 3, label: 'Wireless', image: DIR + 'Network-Pipe-icon.png', shape: 'image'});
edges.push({from: 1, to: 2, length: LENGTH_MAIN});
edges.push({from: 1, to: 2, title:'world', length: LENGTH_MAIN});
edges.push({from: 1, to: 3, length: LENGTH_MAIN}); edges.push({from: 1, to: 3, length: LENGTH_MAIN});
for (var i = 4; i <= 7; i++) { for (var i = 4; i <= 7; i++) {

+ 9
- 4
lib/network/Network.js View File

@ -1301,6 +1301,7 @@ Network.prototype._checkShowPopup = function (pointer) {
var id; var id;
var lastPopupNode = this.popupObj; var lastPopupNode = this.popupObj;
var nodeUnderCursor = false;
if (this.popupObj == undefined) { if (this.popupObj == undefined) {
// search the nodes for overlap, select the top one in case of multiple nodes // search the nodes for overlap, select the top one in case of multiple nodes
@ -1308,15 +1309,19 @@ Network.prototype._checkShowPopup = function (pointer) {
for (id in nodes) { for (id in nodes) {
if (nodes.hasOwnProperty(id)) { if (nodes.hasOwnProperty(id)) {
var node = nodes[id]; var node = nodes[id];
if (node.getTitle() !== undefined && node.isOverlappingWith(obj)) {
this.popupObj = node;
break;
if (node.isOverlappingWith(obj)) {
if (node.getTitle() !== undefined) {
this.popupObj = node;
break;
}
// if you hover over a node, the title of the edge is not supposed to be shown.
nodeUnderCursor = true;
} }
} }
} }
} }
if (this.popupObj === undefined) {
if (this.popupObj === undefined && nodeUnderCursor == false) {
// search the edges for overlap // search the edges for overlap
var edges = this.edges; var edges = this.edges;
for (id in edges) { for (id in edges) {

Loading…
Cancel
Save