Skip to content

Commit

Permalink
Fixed bug with interact not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
ShawnClake authored Apr 20, 2017
1 parent 108647e commit f4d93c5
Showing 1 changed file with 38 additions and 35 deletions.
73 changes: 38 additions & 35 deletions assets/js/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,26 +95,28 @@ UE.Utils.Validator = new Validator();
* Interactions
*/
$(window).load(function() {
console.log('test');
interact('.draggable-row')
.draggable({
// enable inertial throwing
inertia: UE.Interactions.Config.DragDrop.Inertia,
// keep the element within the area of it's parent

// enable autoScroll
autoScroll: UE.Interactions.Config.DragDrop.AutoScroll,
restrict: {
restriction: "drop_container",
endOnly: true,
elementRect: { top: 0, left: 0, bottom: 1, right: 1 }
},
// call this function on every dragmove event
onmove: moveEventHandler,
onstart: startEventHandler,
onend: stopEventHandler
// call this function on every dragend event
});
//console.log('test');
if(typeof interact !== "undefined") {
interact('.draggable-row')
.draggable({
// enable inertial throwing
inertia: UE.Interactions.Config.DragDrop.Inertia,
// keep the element within the area of it's parent

// enable autoScroll
autoScroll: UE.Interactions.Config.DragDrop.AutoScroll,
restrict: {
restriction: "drop_container",
endOnly: true,
elementRect: { top: 0, left: 0, bottom: 1, right: 1 }
},
// call this function on every dragmove event
onmove: moveEventHandler,
onstart: startEventHandler,
onend: stopEventHandler
// call this function on every dragend event
});
}

function stopEventHandler (event) {
var target = $(event.target);
Expand Down Expand Up @@ -223,21 +225,22 @@ $(window).load(function() {
}

$(function() {
for(var handler in UE.Interactions.Dropzones)
{
if(!UE.Interactions.Dropzones.hasOwnProperty(handler)) continue;

var drops = UE.Interactions.Dropzones[handler]['drops'];
var row = UE.Interactions.Dropzones[handler]['row'];
console.log(handler);
console.log(row);
console.log(drops);
for(var i = 0; i < drops.length; i++)
{
makeDropzone(drops[i], row, handler);
}
}

if(typeof interact !== "undefined") {
for(var handler in UE.Interactions.Dropzones)
{
if(!UE.Interactions.Dropzones.hasOwnProperty(handler)) continue;

var drops = UE.Interactions.Dropzones[handler]['drops'];
var row = UE.Interactions.Dropzones[handler]['row'];
console.log(handler);
console.log(row);
console.log(drops);
for(var i = 0; i < drops.length; i++)
{
makeDropzone(drops[i], row, handler);
}
}
}
});

});

0 comments on commit f4d93c5

Please sign in to comment.