mirror of
https://github.com/nasa/openmct.git
synced 2025-06-15 21:58:13 +00:00
[Drag-Drop] Check for default prevented correctly
Check for defaultPrevented property instead of trying to check nonexistent method isDefaultPrevented(); for WTD-1354 in the context of WTD-1233.
This commit is contained in:
@ -250,7 +250,7 @@ define(
|
|||||||
// Position a panel after a drop event
|
// Position a panel after a drop event
|
||||||
function handleDrop(e, id, position) {
|
function handleDrop(e, id, position) {
|
||||||
// Don't handle this event if it has already been handled
|
// Don't handle this event if it has already been handled
|
||||||
if (e.isDefaultPrevented()) {
|
if (e.defaultPrevented) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
@ -109,7 +109,7 @@ define(
|
|||||||
|
|
||||||
// Position a panel after a drop event
|
// Position a panel after a drop event
|
||||||
function handleDrop(e, id, position) {
|
function handleDrop(e, id, position) {
|
||||||
if (e.isDefaultPrevented()) {
|
if (e.defaultPrevented) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Ensure that configuration field is populated
|
// Ensure that configuration field is populated
|
||||||
|
@ -101,7 +101,7 @@ define(
|
|||||||
);
|
);
|
||||||
mockEvent = jasmine.createSpyObj(
|
mockEvent = jasmine.createSpyObj(
|
||||||
'event',
|
'event',
|
||||||
[ 'preventDefault', 'isDefaultPrevented' ]
|
[ 'preventDefault' ]
|
||||||
);
|
);
|
||||||
|
|
||||||
testGrid = [ 123, 456 ];
|
testGrid = [ 123, 456 ];
|
||||||
@ -326,7 +326,7 @@ define(
|
|||||||
|
|
||||||
it("ignores drops when default has been prevented", function () {
|
it("ignores drops when default has been prevented", function () {
|
||||||
// Avoids redundant drop-handling, WTD-1233
|
// Avoids redundant drop-handling, WTD-1233
|
||||||
mockEvent.isDefaultPrevented.andReturn(true);
|
mockEvent.defaultPrevented = true;
|
||||||
|
|
||||||
// Notify that a drop occurred
|
// Notify that a drop occurred
|
||||||
testModel.composition.push('d');
|
testModel.composition.push('d');
|
||||||
|
@ -40,7 +40,7 @@ define(
|
|||||||
);
|
);
|
||||||
mockEvent = jasmine.createSpyObj(
|
mockEvent = jasmine.createSpyObj(
|
||||||
'event',
|
'event',
|
||||||
[ 'preventDefault', 'isDefaultPrevented' ]
|
[ 'preventDefault' ]
|
||||||
);
|
);
|
||||||
|
|
||||||
testModel = {
|
testModel = {
|
||||||
@ -164,7 +164,7 @@ define(
|
|||||||
|
|
||||||
it("ignores drops when default has been prevented", function () {
|
it("ignores drops when default has been prevented", function () {
|
||||||
// Avoids redundant drop-handling, WTD-1233
|
// Avoids redundant drop-handling, WTD-1233
|
||||||
mockEvent.isDefaultPrevented.andReturn(true);
|
mockEvent.defaultPrevented = true;
|
||||||
|
|
||||||
// Notify that a drop occurred
|
// Notify that a drop occurred
|
||||||
testModel.composition.push('d');
|
testModel.composition.push('d');
|
||||||
|
Reference in New Issue
Block a user