[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:
Victor Woeltjen
2015-06-26 11:53:45 -07:00
parent f681d07643
commit 286ac5628b
4 changed files with 6 additions and 6 deletions

View File

@ -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();

View File

@ -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

View File

@ -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');

View File

@ -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');