Comparing version 0.4.0 to 0.5.0
@@ -16,3 +16,3 @@ (function (global, factory) { | ||
this.max = this.rect[this.dimension] - this.min; | ||
this.container.addEventListener('mousemove', this.resize); | ||
window.addEventListener('mousemove', this.resize); | ||
window.addEventListener('mouseup', this.stopResize); | ||
@@ -26,3 +26,3 @@ }; | ||
e.stopPropagation(); | ||
this.container.removeEventListener('mousemove', this.resize); | ||
window.removeEventListener('mousemove', this.resize); | ||
}; | ||
@@ -29,0 +29,0 @@ this.dimension = (this.orientation == 'horizontal') ? 'width' : 'height'; |
@@ -12,3 +12,3 @@ "use strict"; | ||
this.max = this.rect[this.dimension] - this.min; | ||
this.container.addEventListener('mousemove', this.resize); | ||
window.addEventListener('mousemove', this.resize); | ||
window.addEventListener('mouseup', this.stopResize); | ||
@@ -22,3 +22,3 @@ }; | ||
e.stopPropagation(); | ||
this.container.removeEventListener('mousemove', this.resize); | ||
window.removeEventListener('mousemove', this.resize); | ||
}; | ||
@@ -25,0 +25,0 @@ this.dimension = (this.orientation == 'horizontal') ? 'width' : 'height'; |
{ | ||
"name": "ictinus", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"main": "dist/ictinus.js", | ||
@@ -5,0 +5,0 @@ "author": "Paris Kasidiaris <paris@sourcelair.com>", |
@@ -55,3 +55,2 @@ import * as chai from 'chai'; | ||
before(() => { | ||
chai.spy.on(container, 'addEventListener'); | ||
chai.spy.on(window, 'addEventListener'); | ||
@@ -65,3 +64,3 @@ | ||
it('should set the appropriate `mousemove` callback on the container', () => { | ||
chai.expect(container.addEventListener).to.have.been.called.once.with( | ||
chai.expect(window.addEventListener).to.have.been.first.called.with( | ||
'mousemove', <any>layout.resize, | ||
@@ -72,3 +71,3 @@ ); | ||
it('should set the appropriate `mouseup` callback on the window', () => { | ||
chai.expect(window.addEventListener).to.have.been.called.once.with( | ||
chai.expect(window.addEventListener).to.have.been.second.called.with( | ||
'mouseup', <any>layout.stopResize, | ||
@@ -197,3 +196,3 @@ ); | ||
before(() => { | ||
chai.spy.on(layout.container, 'removeEventListener'); | ||
chai.spy.on(window, 'removeEventListener'); | ||
layout.stopResize(mouseUpEvent); | ||
@@ -203,3 +202,3 @@ }); | ||
it('should remove the `resize` callback from the `mousemove` event on the container', () => { | ||
chai.expect(layout.container.removeEventListener).to.have.been.called.once.with( | ||
chai.expect(window.removeEventListener).to.have.been.called.once.with( | ||
'mousemove', <any>layout.resize, | ||
@@ -206,0 +205,0 @@ ); |
@@ -33,3 +33,3 @@ export class BareSplitLayout { | ||
this.max = this.rect[this.dimension] - this.min; | ||
this.container.addEventListener('mousemove', this.resize); | ||
window.addEventListener('mousemove', this.resize); | ||
window.addEventListener('mouseup', this.stopResize); | ||
@@ -57,3 +57,3 @@ } | ||
e.stopPropagation(); | ||
this.container.removeEventListener('mousemove', this.resize); | ||
window.removeEventListener('mousemove', this.resize); | ||
} | ||
@@ -60,0 +60,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
114901
450