Commit db123bf6 authored by Curtis Adam's avatar Curtis Adam

Use the editCard onCreated event to get the card data

parent fa8a1a7a
import {Cardsets} from "../../api/cardsets.js";
import {Cards} from "../../api/cards.js";
import {Leitner, Wozniak} from "../../api/learned";
import {Meteor} from "meteor/meteor";
import {Session} from "meteor/session";
import {CardVisuals} from "../../api/cardVisuals.js";
import {Route} from "../../api/route.js";
import {CardEditor} from "../../api/cardEditor";
import {Filter} from "../../api/filter";
import {MarkdeepEditor} from "../../api/markdeepEditor";
import {WebPushNotifications} from "../../api/webPushSubscriptions";
......@@ -444,7 +442,6 @@ Router.route('/cardset/:_id/editcard/:card_id', {
},
data: function () {
Session.set('helpFilter', "cardEditor");
CardEditor.loadEditModeContent(Cards.findOne({_id: this.params.card_id}));
},
action: function () {
if (this.ready()) {
......
......@@ -7,6 +7,7 @@ import {Cardsets} from "../../api/cardsets";
import {CardEditor} from "../../api/cardEditor.js";
import {CardVisuals} from "../../api/cardVisuals";
import ResizeSensor from "../../../client/resize_sensor/ResizeSensor";
import {Cards} from "../../api/cards";
/*
......@@ -75,4 +76,5 @@ Template.editCard.onCreated(function () {
Session.set('difficultyColor', Cardsets.findOne({_id: Router.current().params._id}).difficulty);
Session.set('mobilePreview', 1);
Session.set('mobilePreviewRotated', 0);
CardEditor.loadEditModeContent(Cards.findOne({_id: Router.current().params.card_id}));
});
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