Browse Source

added oldWidth and oldHeight to resize event

v3_develop
Alex de Mulder 10 years ago
parent
commit
e5394078c7
4 changed files with 3843 additions and 3836 deletions
  1. +1
    -0
      HISTORY.md
  2. +3837
    -3835
      dist/vis.js
  3. +2
    -0
      docs/network.html
  4. +3
    -1
      lib/network/Network.js

+ 1
- 0
HISTORY.md View File

@ -14,6 +14,7 @@ http://visjs.org
- Fixed node label becoming undefined.
- Fixed cluster fontsize scaling.
- Fixed cluster sector scaling.
- Added oldHeight and oldWidth to resize event.
### Timeline

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


+ 2
- 0
docs/network.html View File

@ -2429,6 +2429,8 @@ network.off('select', onSelect);
<ul>
<li><code>width</code>: the new width of the canvas</li>
<li><code>height</code>: the new height of the canvas</li>
<li><code>oldWidth</code>: the old width of the canvas</li>
<li><code>oldHeight</code>: the old height of the canvas</li>
</ul>
</td>
</tr>

+ 3
- 1
lib/network/Network.js View File

@ -1296,6 +1296,8 @@ Network.prototype._checkHidePopup = function (pointer) {
*/
Network.prototype.setSize = function(width, height) {
var emitEvent = false;
var oldWidth = this.frame.canvas.width;
var oldHeight = this.frame.canvas.height;
if (width != this.constants.width || height != this.constants.height || this.frame.style.width != width || this.frame.style.height != height) {
this.frame.style.width = width;
this.frame.style.height = height;
@ -1326,7 +1328,7 @@ Network.prototype.setSize = function(width, height) {
}
if (emitEvent == true) {
this.emit('resize', {width:this.frame.canvas.width,height:this.frame.canvas.height});
this.emit('resize', {width:this.frame.canvas.width,height:this.frame.canvas.height, oldWidth: oldWidth, oldHeight: oldHeight});
}
};

Loading…
Cancel
Save