Commit 9ef0c563 by Valera Rozuvan Committed by Alexander Kryklia

Slight changes in UI styling.

parent 3bbe0759
...@@ -104,6 +104,8 @@ define(['logme', 'update_input'], function (logme, updateInput) { ...@@ -104,6 +104,8 @@ define(['logme', 'update_input'], function (logme, updateInput) {
if (objIndex + 1 === numDraggables) { if (objIndex + 1 === numDraggables) {
state.draggablesLoaded = true; state.draggablesLoaded = true;
state.updateArrowOpacity();
} }
return; return;
...@@ -185,6 +187,8 @@ define(['logme', 'update_input'], function (logme, updateInput) { ...@@ -185,6 +187,8 @@ define(['logme', 'update_input'], function (logme, updateInput) {
} }
} }
state.updateArrowOpacity();
updateInput(state); updateInput(state);
return; return;
......
...@@ -8,7 +8,7 @@ define(['logme'], function (logme) { ...@@ -8,7 +8,7 @@ define(['logme'], function (logme) {
return Scroller; return Scroller;
function Scroller(state) { function Scroller(state) {
var parentEl, moveLeftEl, showEl, moveRightEL, showElLeftMargin; var parentEl, moveLeftEl, showEl, moveRightEl, showElLeftMargin;
parentEl = $( parentEl = $(
'<div ' + '<div ' +
...@@ -32,11 +32,8 @@ define(['logme'], function (logme) { ...@@ -32,11 +32,8 @@ define(['logme'], function (logme) {
'>' + '>' +
'<div ' + '<div ' +
'style=" ' + 'style=" ' +
'width: 80%; ' + 'width: 38px; ' +
'height: 50px; '+ 'height: 100px; '+
'margin-left: auto; ' +
'margin-right: auto; ' +
'margin-top: 26px; ' +
'border: 1px solid #CCC; ' + 'border: 1px solid #CCC; ' +
'background-color: #EEE; ' + 'background-color: #EEE; ' +
...@@ -51,8 +48,6 @@ define(['logme'], function (logme) { ...@@ -51,8 +48,6 @@ define(['logme'], function (logme) {
'background-image: url(\'/static/images/arrow-left.png\'); ' + 'background-image: url(\'/static/images/arrow-left.png\'); ' +
'background-position: center center; ' + 'background-position: center center; ' +
'background-repeat: no-repeat; ' + 'background-repeat: no-repeat; ' +
'border-radius: 35px 0 0 35px; ' +
'" ' + '" ' +
'></div>' + '></div>' +
'</div>' '</div>'
...@@ -77,7 +72,10 @@ define(['logme'], function (logme) { ...@@ -77,7 +72,10 @@ define(['logme'], function (logme) {
state.sliderEl.animate({ state.sliderEl.animate({
'margin-left': showElLeftMargin + 'px' 'margin-left': showElLeftMargin + 'px'
}, 100, function () { }, 100, function () {
// Check if at the end, and make arrow less visible. // Check if at the end, and make arrow less visibl.
logme('showElLeftMargin = ' + showElLeftMargin);
updateArrowOpacity();
}); });
}); });
...@@ -117,11 +115,8 @@ define(['logme'], function (logme) { ...@@ -117,11 +115,8 @@ define(['logme'], function (logme) {
'>' + '>' +
'<div ' + '<div ' +
'style=" ' + 'style=" ' +
'width: 80%; ' + 'width: 38px; ' +
'height: 50px; '+ 'height: 100px; '+
'margin-left: auto; ' +
'margin-right: auto; ' +
'margin-top: 26px; ' +
'border: 1px solid #CCC; ' + 'border: 1px solid #CCC; ' +
'background-color: #EEE; ' + 'background-color: #EEE; ' +
...@@ -136,8 +131,6 @@ define(['logme'], function (logme) { ...@@ -136,8 +131,6 @@ define(['logme'], function (logme) {
'background-image: url(\'/static/images/arrow-right.png\'); ' + 'background-image: url(\'/static/images/arrow-right.png\'); ' +
'background-position: center center; ' + 'background-position: center center; ' +
'background-repeat: no-repeat; ' + 'background-repeat: no-repeat; ' +
'border-radius: 0 35px 35px 0; ' +
'" ' + '" ' +
'></div>' + '></div>' +
'</div>' '</div>'
...@@ -159,15 +152,36 @@ define(['logme'], function (logme) { ...@@ -159,15 +152,36 @@ define(['logme'], function (logme) {
} }
showElLeftMargin -= 102; showElLeftMargin -= 102;
state.sliderEl.animate({ state.sliderEl.animate({
'margin-left': showElLeftMargin + 'px' 'margin-left': showElLeftMargin + 'px'
}, 100, function () { }, 100, function () {
// Check if at the end, and make arrow less visible. // Check if at the end, and make arrow less visible.
logme('showElLeftMargin = ' + showElLeftMargin);
logme('-102 * (state.sliderEl.children().length - 6) = ' + (-102 * (state.sliderEl.children().length - 6)));
updateArrowOpacity();
}); });
}); });
parentEl.appendTo(state.containerEl); parentEl.appendTo(state.containerEl);
}
state.updateArrowOpacity = updateArrowOpacity;
return;
function updateArrowOpacity() {
moveLeftEl.children('div').css('opacity', '1');
moveRightEl.children('div').css('opacity', '1');
if (showElLeftMargin < -102 * (state.sliderEl.children().length - 6)) {
moveRightEl.children('div').css('opacity', '.4');
}
if (showElLeftMargin > -102) {
moveLeftEl.children('div').css('opacity', '.4');
}
}
} // End-of: function Scroller(state)
}); });
// End of wrapper for RequireJS. As you can see, we are passing // End of wrapper for RequireJS. As you can see, we are passing
......
...@@ -153,6 +153,8 @@ define(['logme'], function (logme) { ...@@ -153,6 +153,8 @@ define(['logme'], function (logme) {
return; return;
} }
state.updateArrowOpacity();
} }
return; return;
......
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