Commit 49410654 authored by Curtis Adam's avatar Curtis Adam

Move the addToLeitner and addToWozniak calls to the learning template to allow...

Move the addToLeitner and addToWozniak calls to the learning template to allow direct links for newcomers
parent 2ff740b5
......@@ -4,7 +4,6 @@ import {Template} from "meteor/templating";
import {CardType} from "../../../../api/cardTypes";
import {Leitner, Wozniak} from "../../../../api/learned";
import {Cardsets} from "../../../../api/cardsets";
import {CardsetNavigation} from "../../../../api/cardsetNavigation";
import "../modal/chooseFlashcards.js";
import "../modal/leitner.js";
import "../modal/wozniak.js";
......@@ -40,13 +39,11 @@ Template.cardsetNavigationWorkload.helpers({
Template.cardsetNavigationWorkload.events({
"click #learnBox": function () {
CardsetNavigation.addToLeitner(this._id);
Router.go('box', {
_id: this._id
});
},
"click #learnMemo": function () {
Meteor.call("addWozniakCards", this._id);
Router.go('memo', {
_id: this._id
});
......
......@@ -11,6 +11,7 @@ import {PomodoroTimer} from "../../api/pomodoroTimer";
import {Bonus} from "../../api/bonus";
import {Route} from "../../api/route";
import {MainNavigation} from "../../api/mainNavigation";
import {CardsetNavigation} from "../../api/cardsetNavigation";
Session.set('animationPlaying', false);
/*
......@@ -42,6 +43,12 @@ Template.learnAlgorithms.onRendered(function () {
if (localStorage.getItem(MainNavigation.getFirstTimeWozniakString()) !== "true" && Route.isMemo()) {
$('#helpModal').modal('show');
}
if (Route.isBox()) {
CardsetNavigation.addToLeitner(Router.current().params._id);
}
if (Route.isMemo()) {
Meteor.call("addWozniakCards", Router.current().params._id);
}
});
Template.learnAlgorithms.helpers({
......
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