Commit 58483319 by Valera Rozuvan Committed by Alexander Kryklia

Refactoring.

parent 13d53539
...@@ -213,38 +213,30 @@ define(['logme', 'update_input'], function (logme, updateInput) { ...@@ -213,38 +213,30 @@ define(['logme', 'update_input'], function (logme, updateInput) {
} }
function checkIfOnTarget() { function checkIfOnTarget() {
var c1, c2, target; var c1, target;
c1 = 0; for (c1 = 0; c1 < state.targets.length; c1++) {
while (c1 < state.targets.length) {
target = state.targets[c1]; target = state.targets[c1];
if (offsetDE.top + 50 < target.offset.top) { if (offsetDE.top + 50 < target.offset.top) {
c1 += 1;
continue; continue;
} }
if (offsetDE.top + 50 > target.offset.top + target.h) { if (offsetDE.top + 50 > target.offset.top + target.h) {
c1 += 1;
continue; continue;
} }
if (offsetDE.left + 50 < target.offset.left) { if (offsetDE.left + 50 < target.offset.left) {
c1 += 1;
continue; continue;
} }
if (offsetDE.left + 50 > target.offset.left + target.w) { if (offsetDE.left + 50 > target.offset.left + target.w) {
c1 += 1;
continue; continue;
} }
if (state.config.one_per_target === true) { if (
if ( (state.config.one_per_target === true) &&
(target.draggable.length === 1) && (target.draggable.length === 1) &&
(target.draggable[0] !== obj.id) (target.draggable[0] !== obj.id)
) { ) {
c1 += 1; continue;
continue;
}
} }
targetFound = true; targetFound = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment