Commit 08219949 authored by Andreas Gärtner's avatar Andreas Gärtner
Browse files

Task #15812: Add index to carousel indicator and dock it to top position

parent 84e9e3d1
......@@ -35,11 +35,22 @@ Ext.define('ARSnova.view.CustomCarousel', {
/** initialize navigation listeners */
this.initializeNavigationListeners();
/** dock indicator bar to top */
this.dockIndicatorBarToTop();
/** initialize carousel listeners */
this.on('add', this.checkNavigationElements);
this.on('resize', this.checkNavigationElements);
},
dockIndicatorBarToTop: function () {
this.getIndicator().setBottom('initial');
this.on('add', function (carousel, item, index) {
item.getActiveItem().setStyle('margin-top: 3em');
});
},
doSetActiveItem: function () {
this.callParent(arguments);
......
......@@ -33,8 +33,10 @@ Ext.define('ARSnova.view.CustomCarouselIndicator', {
},
addIndicator: function () {
var index = this.indicators.length;
this.indicators.push(this.element.createChild({
tag: 'span'
tag: 'span',
html: '<p>' + (index + 1) + '</p>'
}));
if (!this.hasItems) {
......
......@@ -29,7 +29,7 @@ Ext.define('ARSnova.view.FreetextQuestion', {
config: {
viewOnly: false,
padding: '0 0 50 0',
padding: '0 0 20 0',
scrollable: {
direction: 'vertical',
......
......@@ -37,7 +37,7 @@ Ext.define('ARSnova.view.Question', {
],
config: {
padding: '0 0 50 0',
padding: '0 0 20 0',
scrollable: {
direction: 'vertical',
......
......@@ -29,15 +29,23 @@
}
.x-carousel-indicator-horizontal {
height: 3.5em;
height: 3em;
&.x-carousel-indicator span {
height: 30px;
margin: 15px 5px;
margin: 7.5px 5px;
width: 30px;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
& p {
margin-left: auto;
margin-right: auto;
margin-top: 4px;
display: table;
color: white;
}
}
}
......
Supports Markdown
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