From ec60411cce09ad62171bb80b0a44563ca4f31c90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20G=C3=A4rtner?= <andreas.gaertner@mni.thm.de> Date: Wed, 5 Oct 2016 13:18:24 +0200 Subject: [PATCH] Add configuration option for max carousel inner item width --- src/main/webapp/app/view/CustomCarousel.js | 6 ++++++ src/main/webapp/resources/sass/_theme.scss | 3 ++- src/main/webapp/resources/sass/app/_general.scss | 6 ++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/app/view/CustomCarousel.js b/src/main/webapp/app/view/CustomCarousel.js index 6c12d4c59..ffd525631 100755 --- a/src/main/webapp/app/view/CustomCarousel.js +++ b/src/main/webapp/app/view/CustomCarousel.js @@ -108,6 +108,12 @@ Ext.define('ARSnova.view.CustomCarousel', { screenWidth = (window.innerWidth > 0) ? window.innerWidth : screen.width, showNavigationElements = screenWidth >= 840 && innerItemCount > 0 && activeIndex !== -1; + if (showNavigationElements) { + this.addCls('setMaxCaruselWidth'); + } else { + this.removeCls('setMaxCaruselWidth'); + } + if (showNavigationElements && activeIndex !== 0) { this.leftArrow.removeCls('hidden'); } else { diff --git a/src/main/webapp/resources/sass/_theme.scss b/src/main/webapp/resources/sass/_theme.scss index 7195e0df2..7df95f0fa 100644 --- a/src/main/webapp/resources/sass/_theme.scss +++ b/src/main/webapp/resources/sass/_theme.scss @@ -207,7 +207,8 @@ $statistics-incorrect-color: $brand-danger; $statistics-abstention-color: $default-grey-color; -/** carousel indicator and navigation color configuration **/ +/** carousel width, indicator and navigation configuration **/ +$carousel-inner-max-width: 85%; $carousel-indicator-color: $brand-primary; $carousel-indicator-active-color: $brand-secondary; $carousel-indicator-unanswered-question-color: $brand-warning; diff --git a/src/main/webapp/resources/sass/app/_general.scss b/src/main/webapp/resources/sass/app/_general.scss index 8155b5e20..bcb28003a 100644 --- a/src/main/webapp/resources/sass/app/_general.scss +++ b/src/main/webapp/resources/sass/app/_general.scss @@ -726,3 +726,9 @@ code { margin: 8px; } } + +.setMaxCaruselWidth { + .x-container.x-form { + max-width: $carousel-inner-max-width; + } +} -- GitLab