Commit b3990677 authored by Curtis Adam's avatar Curtis Adam

Move the card navigation to a sidebar

parent 6222d363
......@@ -6,7 +6,8 @@
@import '../imports/ui/cardset/cardset.scss';
@import '../imports/ui/cardsets/resultItem';
@import '../imports/ui/card/card.scss';
@import '../imports/ui/card/header/item/zoomText.scss';
@import '../imports/ui/card/sidebar/sidebar.scss';
@import '../imports/ui/card/sidebar/item/zoomText';
@import '../imports/ui/card/navigation/navigation.scss';
@import '../imports/ui/markdeepEditor/content/content';
@import '../imports/ui/markdeepEditor/navigation/navigation';
......
......@@ -211,6 +211,9 @@ $themes: (
$background_post_it_lines: map-get($map, "background_post_it_lines");
$background_pink: map-get($map, "background_pink");
$background_pink_lines: map-get($map, "background_pink_lines");
//card sidebar colors
$card_sidebar_border: map-get($map, "card_sidebar_border");
$card_sidebar_background: map-get($map, "card_sidebar_background");
//cardset colors
$cardset_markdeep_background: map-get($map, "cardset_markdeep_background");
$cardset_markdeep_header_border: map-get($map, "cardset_markdeep_header_border");
......@@ -2443,5 +2446,11 @@ $themes: (
.mobilePreviewContent {
background-color: $background_mobile_preview !important;
}
//card sidebar
#flashcardSidebarLeft, #flashcardSidebarRight {
border-color: $card_sidebar_border !important;
background-color: $card_sidebar_background !important;
}
}
}
......@@ -262,6 +262,9 @@
"card_content_zoom_slider_container_percentage": $thm_orange,
"card_content_zoom_slider_container_bar": white,
"card_content_zoom_slider_container_handle": $thm_orange,
//card sidebar colors
"card_sidebar_border": black,
"card_sidebar_background" : white,
//cardset colors
"cardset_markdeep_background": LightGoldenRodYellow,
"cardset_markdeep_header_border": $thm_orange,
......
......@@ -264,6 +264,9 @@
"card_content_zoom_slider_container_percentage": $thm_orange,
"card_content_zoom_slider_container_bar": white,
"card_content_zoom_slider_container_handle": $thm_orange,
//card sidebar colors
"card_sidebar_border": $thm_gray,
"card_sidebar_background" : $mercury_approx,
//cardset colors
"cardset_markdeep_background": LightGoldenRodYellow,
"cardset_markdeep_header_border": $thm_orange,
......
......@@ -972,6 +972,8 @@
"backToCardset": "Zurück zur Karteiansicht",
"endPresentation": "Präsentation beenden",
"fullscreen": "Mit der Taste ESC (oben links) kommst du wieder in die Normalansicht.",
"nextCard": "Zur nächsten Karte wechseln",
"previousCard": "Zur vorherigen Karte wechseln",
"lockSide": "Rückseite wird zur Vorderseite",
"showIndex": "Zeige das Inhaltsverzeichnis der Kartei",
"edit": "Bearbeite die Karte",
......
......@@ -974,6 +974,8 @@
"backToCardset": "",
"endPresentation": "Close presentation",
"fullscreen": "With ESCAPE you get back to the normal view.",
"nextCard": "Switch to the next card",
"previousCard": "Switch to the previous card",
"lockSide": "Back of the card becomes the front side.",
"showIndex": "",
"edit": "",
......
......@@ -111,6 +111,8 @@ export let CardNavigation = class CardNavigation {
CardNavigation.toggleVisibility(false);
});
flashcardCarousel.on('slid.bs.carousel', function () {
$('.scrollLeft').removeClass('pressed');
$('.scrollRight').removeClass('pressed');
CardNavigation.setActiveCardData();
Session.set('isQuestionSide', true);
if (updateLearningMode === 1) {
......@@ -153,8 +155,10 @@ export let CardNavigation = class CardNavigation {
static skipAnswer (scrollRight = true) {
if (scrollRight) {
$('.scrollRight').addClass('pressed');
$('.carousel').carousel('next');
} else {
$('.scrollLeft').addClass('pressed');
$('.carousel').carousel('prev');
}
this.toggleVisibility(false);
......
......@@ -4,6 +4,7 @@ import {CardType} from "./cardTypes";
import * as screenfull from 'screenfull';
import {NavigatorCheck} from "./navigatorCheck";
import {Cardsets} from "./cardsets";
import {MarkdeepEditor} from "./markdeepEditor";
let editorFullScreenActive = false;
let defaultFontSize = 16;
......@@ -95,6 +96,7 @@ export let CardVisuals = class CardVisuals {
} else {
contentEditor.css('height', newFlashcardHeight - $('#markdeepNavigation').height());
}
this.setSidebarPosition();
}
}
......@@ -317,9 +319,8 @@ export let CardVisuals = class CardVisuals {
let cardHeader = $('.cardHeader');
let zoomTextButton = $('.zoomTextButton:visible');
if (cardHeader.length && zoomTextButton.length) {
let leftPosition = 0;
let topPosition = cardHeader.offset().top + cardHeader.height();
leftPosition = zoomTextButton.offset().left - zoomSliderContainer.width();
let topPosition = cardHeader.offset().top;
let leftPosition = zoomTextButton.offset().left - $('#flashcardSidebarRight').width() * 4.5;
zoomSliderContainer.css({
'top': topPosition + "px",
'left': leftPosition + "px"
......@@ -327,4 +328,32 @@ export let CardVisuals = class CardVisuals {
}
}
}
static setSidebarPosition () {
let cardHeaderHeight = $('.cardHeader').height();
let leftSidebar = $('#flashcardSidebarLeft');
let rightSidebar = $('#flashcardSidebarRight');
let leftSidebarElementCount = $('#flashcardSidebarLeft .card-button').length;
let rightSidebarElementCount = $('#flashcardSidebarRight .card-button').length;
if (leftSidebarElementCount === 0) {
leftSidebar.css('display', 'none');
} else {
leftSidebar.css('display', 'block');
}
if (rightSidebarElementCount === 0) {
rightSidebar.css('display', 'none');
} else {
rightSidebar.css('display', 'block');
}
if (Route.isEditMode() && MarkdeepEditor.getMobilePreview()) {
cardHeaderHeight += $('.mobilePreviewContent .cardToolbar').height() + 15;
leftSidebar.addClass('flashcardSidebarPreviewLeft');
rightSidebar.addClass('flashcardSidebarPreviewRight');
} else {
leftSidebar.removeClass('flashcardSidebarPreviewLeft');
rightSidebar.removeClass('flashcardSidebarPreviewRight');
}
leftSidebar.css('margin-top', cardHeaderHeight + 'px');
rightSidebar.css('margin-top', cardHeaderHeight + 'px');
}
};
......@@ -6,16 +6,22 @@
<div>
<div id="cardCarousel" class="carousel slide" data-keyboard="false" data-interval="false">
<div class="carousel-inner">
{{#unless isMobilePreviewActive}}
{{> flashcardSidebar}}
{{/unless}}
{{#each getCards}}
<div class="item {{#if isActiveCard true}}active{{/if}}" data-id="{{_id}}">
<div class="box flashcard">
<div class="cardHeader {{#if
isActiveCard false}}{{getCardSideColorActive}}{{else}}{{getCardSideColorInactive}}{{/if}}-header"
isActiveCard
false}}{{getCardSideColorActive}}{{else}}{{getCardSideColorInactive}}{{/if}}-header"
data-cardtype="{{cardType}}">
{{> flashcardHeader this}}
</div>
<div class="cardContent detail{{cardsIndex this._id}} {{#if
isActiveCard false}}{{getCardSideColorActive}}{{else}}{{getCardSideColorInactive}}{{/if}}">
isActiveCard
false}}{{getCardSideColorActive}}{{else}}{{getCardSideColorInactive}}{{/if}}">
{{> cardContentCounter this}}
{{#if isActiveCard false}}
{{#if isBeolingusDictionary}}
{{> cardDictionaryContentBeolingus this}}
......@@ -36,7 +42,6 @@
</div>
{{/each}}
</div>
{{> cardArrowNavigation this}}
</div>
</div>
</div>
......
......@@ -146,6 +146,9 @@ Template.flashcards.helpers({
},
getCardSideColorInactive: function () {
return CardVisuals.getCardSideColor(this.difficulty, this.cardType, this.backgroundStyle, false);
},
isMobilePreviewActive: function () {
return Session.get('mobilePreview') && Route.isEditMode();
}
});
......
......@@ -236,10 +236,6 @@ img.cardside {
.card-button {
cursor: pointer;
font-size: $font_size_card_header_button !important;
@media(max-width: 767px) {
font-size: $font_size_card_header_mobile_button !important;
padding: 2px 4px !important;
}
}
.cardHeader a:hover {
......@@ -519,9 +515,6 @@ img.cardside {
padding-left: 20px;
}
}
.card-button {
font-size: $font_size_card_header_mobile_button !important;
}
.cardHeaderSmallText {
font-size: $font_size_card_header_small_text_mobile;
}
......@@ -566,3 +559,15 @@ img.cardside {
height: auto;
}
}
.cardCounter {
position: absolute;
width: 100%;
text-align: center;
margin-left: -$padding_card_content_horizontal;
margin-top: -$padding_card_content_vertical;
@media(max-width: 767px) {
margin-left: -$padding_card_content_horizontal_mobile;
margin-top: -$padding_card_content_vertical_mobile;
}
}
\ No newline at end of file
<template name="cardContentCounter">
{{#if isCardset}}
{{> cardContentItemCountCards this}}
{{/if}}
{{#if isPresentation}}
{{> cardContentItemCountCards this}}
{{/if}}
{{#if isMakingOf}}
{{> cardContentItemCountCards this}}
{{/if}}
{{#if isDemo}}
{{> cardContentItemCountCards this}}
{{/if}}
{{#if isBox}}
{{> cardContentItemCountCardsLeitner this}}
{{/if}}
</template>
<template name="cardDictionaryContentBeolingus">
<iframe class="dictionaryFrame"
src="https://dict.tu-chemnitz.de/?mini=1?service=deen{{getDictionarySearchText}}"
......
......@@ -8,8 +8,40 @@ import '/client/hammer.js';
import "./content.html";
import {CardNavigation} from "../../../api/cardNavigation";
import {Dictionary} from "../../../api/dictionary";
import "./item/countCards.js";
import "./item/countCardsLeitner.js";
/*
* ############################################################################
* cardContentCounter
* ############################################################################
*/
Template.cardContentCounter.helpers({
isCardset: function () {
return Route.isCardset();
},
isPresentation: function () {
return Route.isPresentation();
},
isMakingOf: function () {
return Route.isMakingOf();
},
isDemo: function () {
return Route.isDemo();
},
isEditMode: function () {
return Route.isEditMode();
},
isBox: function () {
return Route.isBox();
},
isMemo: function () {
return Route.isMemo();
}
});
/*
* ############################################################################
* cardDictionaryContentBeolingus
......
<template name="cardHeaderItemCountCards">
<span class="cardHeaderSmallText">
<template name="cardContentItemCountCards">
<span class="cardHeaderSmallText cardCounter">
{{#unless hasCardsetPermission cardset_id}}
{{_ "preview"}}:
{{cardsIndex this._id}} {{_ "of"}} {{getCardsetCount true}}
......
......@@ -6,11 +6,11 @@ import {Cardsets} from "../../../../api/cardsets";
/*
* ############################################################################
* cardHeaderItemCountCards
* cardContentItemCountCards
* ############################################################################
*/
Template.cardHeaderItemCountCards.helpers({
Template.cardContentItemCountCards.helpers({
cardsIndex: function (card_id) {
let cardIndex = CardIndex.getCardIndex();
return cardIndex.findIndex(item => item === card_id) + 1;
......
<template name="cardHeaderItemCountCardsLeitner">
<span class="cardHeaderSmallText hidden-xs">
<template name="cardContentItemCountCardsLeitner">
<span class="cardHeaderSmallText hidden-xs cardCounter">
{{_ "leitner_status" count=countLeitner}}
</span>
<span class="cardHeaderSmallText visible-xs">
<span class="cardHeaderSmallText visible-xs cardCounter">
{{_ "leitner_status_short" count=countLeitner}}
</span>
</template>
......@@ -5,11 +5,11 @@ import {Leitner} from "../../../../api/learned";
/*
* ############################################################################
* cardHeaderItemCountCardsLeitner
* cardContentItemCountCardsLeitner
* ############################################################################
*/
Template.cardHeaderItemCountCardsLeitner.helpers({
Template.cardContentItemCountCardsLeitner.helpers({
countLeitner: function () {
var maxIndex = Leitner.find({
cardset_id: Session.get('activeCardset')._id,
......
......@@ -3,20 +3,8 @@ import {Route} from "../../../api/route";
import "./header.html";
import "./left/left.js";
import "./right/right.js";
import "./item/cardList.js";
import "./item/contrast.js";
import "./center/center.js";
import "./item/backToCardset.js";
import "./item/clock.js";
import "./item/copy.js";
import "./item/countCards.js";
import "./item/countCardsLeitner.js";
import "./item/delete.js";
import "./item/dictionary.js";
import "./item/edit.js";
import "./item/endPresentation.js";
import "./item/toggleFullscreen.js";
import "./item/zoomText.js";
/*
* ############################################################################
......
<template name="cardHeaderItemCardList">
<i class="card-button cardHeaderItem fa fa-list selectCard" data-id="{{this._id}}" title="{{_ "card.tooltip.showIndex"}}"></i>
</template>
<template name="cardHeaderItemDictionaryBeolingus">
{{#if gotDictionary}}
{{#unless isMobilePreview}}
<span class="cardHeaderTranslatorBtnGroup hidden-xs">
<span class="hidden-xs">
<img class="showBeolingusTranslation card-button cardHeaderItem {{#if isBeolingusActive}}pressed{{/if}}"
data-type="cardNavigation"
data-toggle="collapse"
data-target="#collapseLecture-{{_id}}"
src="/img/beolingus.png" title="{{_ "card.tooltip.dictionaryBeolingus"}}">
</span>
</span>
{{/unless}}
<span class="{{#unless isMobilePreview}}visible-xs-inline-block{{/unless}}">
<i class="card-button cardHeaderItem fa fa-bookmark showBeolingusTranslation {{#if
isBeolingusActive}}pressed{{/if}}"
data-id="{{this._id}}" title="{{_ "card.tooltip.dictionaryBeolingus"}}"></i>
</span>
{{/if}}
</template>
<template name="cardHeaderItemDictionaryLinguee">
{{#if gotDictionary}}
{{#unless isMobilePreview}}
<span class="cardHeaderTranslatorBtnGroup hidden-xs">
<span class="hidden-xs">
<img class="showLingueeTranslation card-button cardHeaderItem {{#if isLingueeActive}}pressed{{/if}}"
data-type="cardNavigation"
data-toggle="collapse"
data-target="#collapseLecture-{{_id}}"
src="/img/linguee_appLogoSmall.png" title="{{_ "card.tooltip.dictionaryLinguee"}}">
</span>
</span>
{{/unless}}
<span class="{{#unless isMobilePreview}}visible-xs-inline-block{{/unless}}">
<i class="card-button cardHeaderItem fa fa-language showLingueeTranslation {{#if
isLingueeActive}}pressed{{/if}}"
data-id="{{this._id}}" title="{{_ "card.tooltip.dictionaryLinguee"}}"></i>
</span>
{{/if}}
</template>
<template name="cardHeaderItemDictionaryGoogle">
{{#if gotDictionary}}
{{#unless isMobilePreview}}
<span class="cardHeaderTranslatorBtnGroup hidden-xs">
<span class="hidden-xs">
<img class="showGoogleTranslation card-button cardHeaderItem {{#if isGoogleActive}}pressed{{/if}}"
data-type="cardNavigation"
data-toggle="collapse"
data-target="#collapseLecture-{{_id}}"
src="/img/google_translate.png" title="{{_ "card.tooltip.dictionaryGoogle"}}">
</span>
</span>
{{/unless}}
<span class="{{#unless isMobilePreview}}visible-xs-inline-block{{/unless}}">
<i class="card-button cardHeaderItem fa fa-google showGoogleTranslation {{#if
isGoogleActive}}pressed{{/if}}"
data-id="{{this._id}}" title="{{_ "card.tooltip.dictionaryGoogle"}}"></i>
</span>
{{/if}}
</template>
<template name="cardHeaderItemDictionaryDeepL">
{{#if gotDictionary}}
{{#unless isMobilePreview}}
<span class="cardHeaderTranslatorBtnGroup hidden-xs">
<span class="hidden-xs">
<img class="showDeepLTranslation card-button cardHeaderItem {{#if isDeepLActive}}pressed{{/if}}"
data-type="cardNavigation"
data-toggle="collapse"
data-target="#collapseLecture-{{_id}}"
src="/img/deepl.png" title="{{_ "card.tooltip.dictionaryDeepL"}}">
</span>
</span>
{{/unless}}
<span class="{{#unless isMobilePreview}}visible-xs-inline-block{{/unless}}">
<i class="card-button cardHeaderItem fa fa-book showDeepLTranslation {{#if
isDeepLActive}}pressed{{/if}}"
data-id="{{this._id}}" title="{{_ "card.tooltip.dictionaryDeepL"}}"></i>
</span>
{{/if}}
</template>
\ No newline at end of file
......@@ -3,19 +3,6 @@
<div class="cardHeaderGroup">
{{> cardHeaderItemClock}}
</div>
<div class="cardHeaderGroup">
<div class="cardHeaderRowHalf" data-cardtype="{{cardType}}">
{{> cardHeaderItemDictionaryDeepL this}}
{{> cardHeaderItemDictionaryLinguee this}}
</div>
<div class="cardHeaderRowHalf" data-cardtype="{{cardType}}">
{{> cardHeaderItemDictionaryBeolingus this}}
{{> cardHeaderItemDictionaryGoogle this}}
<span class="hidden-sm hidden-md hidden-lg">
{{> cardHeaderItemCardList this}}
</span>
</div>
</div>
</div>
</template>
......@@ -26,16 +13,6 @@
{{> cardHeaderItemClock}}
{{/unless}}
</div>
<div class="cardHeaderGroup">
<div class="cardHeaderRowHalf" data-cardtype="{{cardType}}">
{{> cardHeaderItemDictionaryDeepL this}}
{{> cardHeaderItemDictionaryLinguee this}}
</div>
<div class="cardHeaderRowHalf" data-cardtype="{{cardType}}">
{{> cardHeaderItemDictionaryBeolingus this}}
{{> cardHeaderItemDictionaryGoogle this}}
</div>
</div>
</div>
</template>
......@@ -43,15 +20,8 @@
<div class="col-xs-3 cardHeaderLeft" data-cardtype="{{cardType}}">
<div class="cardHeaderGroup">
<div class="cardHeaderRowHalf" data-cardtype="{{cardType}}">
{{> cardHeaderItemDictionaryDeepL this}}
{{> cardHeaderItemDictionaryLinguee this}}
{{> cardHeaderItemDictionaryBeolingus this}}
{{> cardHeaderItemDictionaryGoogle this}}
</div>
<div class="cardHeaderRowHalf" data-cardtype="{{cardType}}">
{{> cardHeaderItemEdit this}}
{{> cardHeaderItemDelete this}}
</div>
</div>
</div>
......@@ -64,12 +34,8 @@
</div>
<div class="cardHeaderGroup">
<div class="cardHeaderRowHalf" data-cardtype="{{cardType}}">
{{> cardHeaderItemDictionaryDeepL this}}
{{> cardHeaderItemDictionaryLinguee this}}
</div>
<div class="cardHeaderRowHalf" data-cardtype="{{cardType}}">
{{> cardHeaderItemDictionaryBeolingus this}}
{{> cardHeaderItemDictionaryGoogle this}}
</div>
</div>
</div>
......@@ -82,12 +48,8 @@
</div>
<div class="cardHeaderGroup">
<div class="cardHeaderRowHalf" data-cardtype="{{cardType}}">
{{> cardHeaderItemDictionaryDeepL this}}
{{> cardHeaderItemDictionaryLinguee this}}
</div>
<div class="cardHeaderRowHalf" data-cardtype="{{cardType}}">
{{> cardHeaderItemDictionaryBeolingus this}}
{{> cardHeaderItemDictionaryGoogle this}}
</div>
</div>
</div>
......
<template name="flashcardHeaderPresentationRight">
<div class="col-xs-3 cardHeaderRight" data-cardtype="{{cardType}}">
<div class="cardHeaderRowHalf" data-cardtype="{{cardType}}">
{{> cardHeaderItemCountCards this}}
</div>
<div class="cardHeaderRowHalf" data-cardtype="{{cardType}}">
<span class="hidden-xs cardHeaderItem">
{{> cardHeaderItemCardList this}}
</span>
{{> cardHeaderItemZoomText}}
<span class="hidden-xs cardHeaderItem">
{{> cardHeaderItemContrast}}
</span>
{{> cardHeaderItemEndPresentation this}}
</div>
</div>
</template>
<template name="flashcardHeaderDemoRight">
<div class="col-xs-3 cardHeaderRight" data-cardtype="{{cardType}}">
<div class="cardHeaderRowHalf" data-cardtype="{{cardType}}">
{{> cardHeaderItemCountCards this}}
</div>
<div class="cardHeaderRowHalf" data-cardtype="{{cardType}}">
{{> cardHeaderItemCardList this}}
{{> cardHeaderItemZoomText}}
{{> cardHeaderItemToggleFullscreen this}}
</div>
</div>
</template>
<template name="flashcardHeaderDefaultRight">
<div class="col-xs-3 cardHeaderRight" data-cardtype="{{cardType}}">
<div class="cardHeaderRowHalf" data-cardtype="{{cardType}}">
{{> cardHeaderItemCountCards this}}
</div>
<div class="cardHeaderRowHalf" data-cardtype="{{cardType}}">
{{> cardHeaderItemCardList this}}
{{> cardHeaderItemZoomText}}
{{> cardHeaderItemToggleFullscreen this}}
</div>
</div>
</template>
<template name="flashcardHeaderEditorRight">
<div class="col-xs-3 cardHeaderRight" data-cardtype="{{cardType}}">
<div class="cardHeaderRowHalf" data-cardtype="{{cardType}}">
</div>
<div class="cardHeaderRowHalf" data-cardtype="{{cardType}}">
{{> cardHeaderItemZoomText}}
{{> cardHeaderItemToggleFullscreen this}}
</div>
</div>
</template>
<template name="flashcardHeaderLeitnerRight">
<div class="col-xs-3 cardHeaderRight" data-cardtype="{{cardType}}">
<div class="cardHeaderRowHalf" data-cardtype="{{cardType}}">
{{> cardHeaderItemCountCardsLeitner this}}
</div>
<div class="cardHeaderRowHalf" data-cardtype="{{cardType}}">
{{> cardHeaderItemZoomText}}
{{> cardHeaderItemToggleFullscreen this}}
{{> cardHeaderItemBackToCardset}}
</div>
</div>
</template>
<template name="flashcardHeaderWozniakRight">
<div class="col-xs-3 cardHeaderRight" data-cardtype="{{cardType}}">
<div class="cardHeaderRowHalf" data-cardtype="{{cardType}}">
</div>
<div class="cardHeaderRowHalf" data-cardtype="{{cardType}}">
{{> cardHeaderItemZoomText}}
{{> cardHeaderItemToggleFullscreen this}}
{{> cardHeaderItemBackToCardset}}
</div>
</div>
</template>
......@@ -52,6 +52,7 @@ Template.cardNavigationEnabled.helpers({
Template.cardNavigationEnabled.onRendered(function () {
CardNavigation.selectButton(1);
CardVisuals.setSidebarPosition();
});
/*
......
<template name="cardHeaderItemBackToCardset">
<template name="cardSidebarItemBackToCardset">
<span class="glyphicon glyphicon-log-out card-button cardHeaderItem backToCardset pressed"
data-type="cardNavigation"
title="{{_ "card.tooltip.backToCardset"}}"></span>
......
......@@ -2,11 +2,11 @@ import "./backToCardset.html";
/*
* ############################################################################
* cardHeaderItemBackToCardset
* cardSidebarItemBackToCardset
* ############################################################################
*/
Template.cardHeaderItemBackToCardset.events({
Template.cardSidebarItemBackToCardset.events({
"click .backToCardset": function () {
Router.go('cardsetdetailsid', {
_id: Router.current().params._id
......
<template name="cardSidebarItemCardList">
{{#if gotMultipleCards}}
<i class="card-button cardHeaderItem fa fa-list selectCard" data-id="{{this._id}}"
title="{{_ "card.tooltip.showIndex"}}"></i>
{{/if}}
</template>
import {Session} from "meteor/session";
import "./cardList.html";
import {Route} from "../../../../api/route";
import {CardIndex} from "../../../../api/cardIndex";
/*
* ############################################################################
* cardHeaderItemCardList
* cardSidebarItemCardList
* ############################################################################
*/
Template.cardHeaderItemCardList.events({
Template.cardSidebarItemCardList.events({
"click .selectCard": function (evt) {
Session.set('activeCard', $(evt.target).data('id'));
if (Route.isCardset()) {
......@@ -26,3 +27,10 @@ Template.cardHeaderItemCardList.events({
}
}
});
Template.cardSidebarItemCardList.helpers({
gotMultipleCards: function () {
return CardIndex.getCardIndex().length > 1;
}
});
<template name="cardHeaderItemContrast">
<template name="cardSidebarItemContrast">
{{#if gotContrastButton this.cardType}}
<i class="card-button cardHeaderItem fa fa-adjust contrastMode {{#if isContrastMode}}pressed{{/if}}"
data-id="{{this._id}}" title="{{_ "card.tooltip.contrast"}}"></i>
......
......@@ -5,11 +5,11 @@ import {CardType} from "../../../../api/cardTypes";
/*
* ############################################################################
* cardHeaderItemContrast
* cardSidebarItemContrast
* ############################################################################
*/
Template.cardHeaderItemContrast.helpers({
Template.cardSidebarItemContrast.helpers({
gotContrastButton: function (cardType) {
return CardType.gotContrastButton(cardType);
},
......@@ -18,7 +18,7 @@ Template.cardHeaderItemContrast.helpers({
}
});
Template.cardHeaderItemContrast.events({
Template.cardSidebarItemContrast.events({
"click .contrastMode": function () {
if (Session.get('contrastMode')) {
Session.set('contrastMode', false);
......