Commit ead346ee by Valera Rozuvan Committed by Alexander Kryklia

Refactoring. New feature: adding multiple draggables from one.

parent e2bbaf08
......@@ -63,7 +63,9 @@ define(
Targets(state);
Scroller(state);
Draggables(state);
Draggables.init(state);
logme('After Draggables.init(state); state = ', state);
// Update the input element, checking first that it is not filled with
// an answer from the server.
......
......@@ -120,15 +120,6 @@ define(['logme'], function (logme) {
lowestZIndex = 10000;
for (c1 = 0; c1 < draggablesInMe.length; c1 += 1) {
logme(
'draggablesInMe[' + c1 + '].id = ' + draggablesInMe[c1].id,
'draggablesInMe[' + c1 + '].zIndex = ' + draggablesInMe[c1].zIndex,
'draggablesInMe[' + c1 + '].oldZIndex = ' + draggablesInMe[c1].oldZIndex
);
}
logme('------------------');
for (c1 = 0; c1 < draggablesInMe.length; c1 += 1) {
if (draggablesInMe[c1].zIndex < lowestZIndex) {
lowestZIndex = draggablesInMe[c1].zIndex;
}
......
......@@ -10,6 +10,8 @@ define(['logme'], function (logme) {
function updateInput(state, checkFirst) {
var inputEl, stateStr, targets, draggables, c1, c2, tempObj;
logme('updateInput; state = ', state);
if (checkFirst === true) {
if (checkIfHasAnswer() === true) {
return;
......@@ -126,7 +128,7 @@ define(['logme'], function (logme) {
return;
}
draggable.setInContainer(false);
draggable.inContainer = false;
draggable.containerEl.hide();
draggable.iconEl.detach();
......@@ -196,7 +198,7 @@ define(['logme'], function (logme) {
);
}
draggable.setOnTarget(target);
draggable.onTarget = target;
target.draggable.push(draggableId);
if (target.numTextEl !== null) {
......@@ -244,7 +246,7 @@ define(['logme'], function (logme) {
return;
}
draggable.setInContainer(false);
draggable.inContainer = false;
draggable.containerEl.hide();
draggable.iconEl.detach();
......
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