Commit ead346ee by Valera Rozuvan Committed by Alexander Kryklia

Refactoring. New feature: adding multiple draggables from one.

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