Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions js/ui/scheduler/ui.scheduler.work_space.js
Original file line number Diff line number Diff line change
Expand Up @@ -1738,6 +1738,12 @@ var SchedulerWorkSpace = Widget.inherit({
delete this._interval;
},

_clean: function() {
eventsEngine.off(domAdapter.getDocument(), SCHEDULER_CELL_DXPOINTERUP_EVENT_NAME);

this.callBase();
},

getWorkArea: function() {
return this._dateTableScrollable.$content();
},
Expand Down
19 changes: 19 additions & 0 deletions testing/tests/DevExpress.ui.widgets.scheduler/workSpace.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -1582,6 +1582,25 @@ QUnit.testStart(function() {
assert.equal(cells.slice(1, 10).filter(".dx-state-focused").length, 9, " right cells are focused");
});

QUnit.test("Pointeruip event subscriptions should be detached on dispose", function(assert) {
var $element = $("#scheduler-work-space").dxSchedulerWorkSpaceMonth({
focusStateEnabled: true,
firstDayOfWeek: 1,
currentDate: new Date(2015, 3, 1)
}),
keyboard = keyboardMock($element);

var cells = $element.find("." + CELL_CLASS);

pointerMock(cells.eq(3)).start().click();
keyboard.keyDown("left", { shiftKey: true });
keyboard.keyDown("right", { shiftKey: true });

$element.dxSchedulerWorkSpaceMonth("instance").dispose();

assert.equal($._data(document, "events"), undefined, "Event subscriptions were detached");
});

QUnit.test("Workspace should allow select/unselect cells with shift & right/left arrow", function(assert) {
var $element = $("#scheduler-work-space").dxSchedulerWorkSpaceMonth({
focusStateEnabled: true,
Expand Down