|
@ -1296,6 +1296,8 @@ Network.prototype._checkHidePopup = function (pointer) { |
|
|
*/ |
|
|
*/ |
|
|
Network.prototype.setSize = function(width, height) { |
|
|
Network.prototype.setSize = function(width, height) { |
|
|
var emitEvent = false; |
|
|
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) { |
|
|
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.width = width; |
|
|
this.frame.style.height = height; |
|
|
this.frame.style.height = height; |
|
@ -1326,7 +1328,7 @@ Network.prototype.setSize = function(width, height) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (emitEvent == true) { |
|
|
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}); |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|