From 4a7cd59250d57f214b34a5b4518c5ce99bb988b6 Mon Sep 17 00:00:00 2001 From: maximXbs Date: Thu, 30 Aug 2012 16:40:19 +0200 Subject: [PATCH] fixed Sankore-704 bug --- .../locales/fr/scripts/blackYellow.js | 31 ++++++++++++++++--- .../locales/ru/scripts/blackYellow.js | 31 ++++++++++++++++--- .../Contraste.wgt/scripts/blackYellow.js | 29 ++++++++++++++--- 3 files changed, 77 insertions(+), 14 deletions(-) diff --git a/resources/library/interactivities/Contraste.wgt/locales/fr/scripts/blackYellow.js b/resources/library/interactivities/Contraste.wgt/locales/fr/scripts/blackYellow.js index 34de0859..3fbfd9aa 100644 --- a/resources/library/interactivities/Contraste.wgt/locales/fr/scripts/blackYellow.js +++ b/resources/library/interactivities/Contraste.wgt/locales/fr/scripts/blackYellow.js @@ -326,6 +326,15 @@ function init(){ $(".closeItem").live("click", function(){ if(!shadowOver){ $(this).parent().remove(); + if($(".editContainer").size() > 0){ + var prev = $(".editContainer:first"); + if((prev.position().left == 54) && (prev.position().top != 60)) + prev.css("top", "60px"); + var prevBottom = prev.position().top + prev.height(), + prevLeft = prev.position().left; + if(prev.next().length) + recursionCall(prevBottom, prevLeft, prev.next()); + } } }); @@ -339,8 +348,7 @@ function init(){ }) function recursionCall(prevBottom, prevLeft, curr){ - var curTop = curr.position().top, - curHeight = curr.height(), + var curHeight = curr.height(), curLeft = curr.position().left; if(prevLeft == curLeft){ if((prevBottom + 15 + curHeight) < ($(window).height() - 54)) @@ -351,7 +359,7 @@ function init(){ if((prevBottom + 15 + curHeight) < ($(window).height() - 54)) curr.css("top", prevBottom + 15 + "px").css("left", prevLeft + "px"); else - curr.css("top", "60px"); + curr.css("top", "60px").css("left", prevLeft + 255 + "px"); } prevBottom = curr.position().top + curr.height(), prevLeft = curr.position().left; @@ -364,7 +372,20 @@ function init(){ popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%"); $(window).resize(function(){ - //$("#leftDiv,#rightDiv,#shadowDiv").css("height", $(window).height()); + if($("#wgt_edit").hasClass("selected")){ + if($(".editContainer").size() > 1){ + var prev = $(".editContainer:first"), + prevBottom = prev.position().top + prev.height(), + prevLeft = prev.position().left; + recursionCall(prevBottom, prevLeft, prev.next()); + } + } else { + var tmp_array = []; + $(".readyTask").each(function(){ + tmp_array.push($(this)); + }); + orderItems(tmp_array); + } popupBack.css("top", ($(window).height() - 138)*50/$(window).height() + "%"); popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%"); }); @@ -564,4 +585,4 @@ function changeStyle(val){ } if($("#wgt_edit").hasClass("selected")) $(document).enableTextSelect(); -} \ No newline at end of file +} diff --git a/resources/library/interactivities/Contraste.wgt/locales/ru/scripts/blackYellow.js b/resources/library/interactivities/Contraste.wgt/locales/ru/scripts/blackYellow.js index fce0a9af..fc0eb152 100644 --- a/resources/library/interactivities/Contraste.wgt/locales/ru/scripts/blackYellow.js +++ b/resources/library/interactivities/Contraste.wgt/locales/ru/scripts/blackYellow.js @@ -326,6 +326,15 @@ function init(){ $(".closeItem").live("click", function(){ if(!shadowOver){ $(this).parent().remove(); + if($(".editContainer").size() > 0){ + var prev = $(".editContainer:first"); + if((prev.position().left == 54) && (prev.position().top != 60)) + prev.css("top", "60px"); + var prevBottom = prev.position().top + prev.height(), + prevLeft = prev.position().left; + if(prev.next().length) + recursionCall(prevBottom, prevLeft, prev.next()); + } } }); @@ -339,8 +348,7 @@ function init(){ }) function recursionCall(prevBottom, prevLeft, curr){ - var curTop = curr.position().top, - curHeight = curr.height(), + var curHeight = curr.height(), curLeft = curr.position().left; if(prevLeft == curLeft){ if((prevBottom + 15 + curHeight) < ($(window).height() - 54)) @@ -351,7 +359,7 @@ function init(){ if((prevBottom + 15 + curHeight) < ($(window).height() - 54)) curr.css("top", prevBottom + 15 + "px").css("left", prevLeft + "px"); else - curr.css("top", "60px"); + curr.css("top", "60px").css("left", prevLeft + 255 + "px"); } prevBottom = curr.position().top + curr.height(), prevLeft = curr.position().left; @@ -364,7 +372,20 @@ function init(){ popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%"); $(window).resize(function(){ - //$("#leftDiv,#rightDiv,#shadowDiv").css("height", $(window).height()); + if($("#wgt_edit").hasClass("selected")){ + if($(".editContainer").size() > 1){ + var prev = $(".editContainer:first"), + prevBottom = prev.position().top + prev.height(), + prevLeft = prev.position().left; + recursionCall(prevBottom, prevLeft, prev.next()); + } + } else { + var tmp_array = []; + $(".readyTask").each(function(){ + tmp_array.push($(this)); + }); + orderItems(tmp_array); + } popupBack.css("top", ($(window).height() - 138)*50/$(window).height() + "%"); popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%"); }); @@ -564,4 +585,4 @@ function changeStyle(val){ } if($("#wgt_edit").hasClass("selected")) $(document).enableTextSelect(); -} \ No newline at end of file +} diff --git a/resources/library/interactivities/Contraste.wgt/scripts/blackYellow.js b/resources/library/interactivities/Contraste.wgt/scripts/blackYellow.js index 27035aaf..89e6df3f 100644 --- a/resources/library/interactivities/Contraste.wgt/scripts/blackYellow.js +++ b/resources/library/interactivities/Contraste.wgt/scripts/blackYellow.js @@ -326,6 +326,15 @@ function init(){ $(".closeItem").live("click", function(){ if(!shadowOver){ $(this).parent().remove(); + if($(".editContainer").size() > 0){ + var prev = $(".editContainer:first"); + if((prev.position().left == 54) && (prev.position().top != 60)) + prev.css("top", "60px"); + var prevBottom = prev.position().top + prev.height(), + prevLeft = prev.position().left; + if(prev.next().length) + recursionCall(prevBottom, prevLeft, prev.next()); + } } }); @@ -339,8 +348,7 @@ function init(){ }) function recursionCall(prevBottom, prevLeft, curr){ - var curTop = curr.position().top, - curHeight = curr.height(), + var curHeight = curr.height(), curLeft = curr.position().left; if(prevLeft == curLeft){ if((prevBottom + 15 + curHeight) < ($(window).height() - 54)) @@ -351,7 +359,7 @@ function init(){ if((prevBottom + 15 + curHeight) < ($(window).height() - 54)) curr.css("top", prevBottom + 15 + "px").css("left", prevLeft + "px"); else - curr.css("top", "60px"); + curr.css("top", "60px").css("left", prevLeft + 255 + "px"); } prevBottom = curr.position().top + curr.height(), prevLeft = curr.position().left; @@ -364,7 +372,20 @@ function init(){ popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%"); $(window).resize(function(){ - //$("#leftDiv,#rightDiv,#shadowDiv").css("height", $(window).height()); + if($("#wgt_edit").hasClass("selected")){ + if($(".editContainer").size() > 1){ + var prev = $(".editContainer:first"), + prevBottom = prev.position().top + prev.height(), + prevLeft = prev.position().left; + recursionCall(prevBottom, prevLeft, prev.next()); + } + } else { + var tmp_array = []; + $(".readyTask").each(function(){ + tmp_array.push($(this)); + }); + orderItems(tmp_array); + } popupBack.css("top", ($(window).height() - 138)*50/$(window).height() + "%"); popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%"); });