Moved save button; Added blurb for the Jr High Summer to the programs page; Fixed the page editor to ask if the user doesn't save the changes.

This commit is contained in:
Wynne Crisman
2019-01-09 16:38:31 -08:00
parent cac2ad9c41
commit 6fdaf93718
3 changed files with 13 additions and 2 deletions

View File

@@ -25,13 +25,14 @@ Tracker.autorun(function() {
Template.PageEditor.onCreated(function() {
let template = this;
currentPath = FlowRouter.getRouteName();
this.showSelectImageDialog = new ReactiveVar(false);
this.pageName = new ReactiveVar();
this.saveChanges = function() {
if(currentPath && currentPath !== FlowRouter.getRouteName()) {
let data = this.$('.editor').val();
let template = this;
const pageName = this.pageName.get();
currentPath = FlowRouter.getRouteName();
@@ -54,7 +55,7 @@ Template.PageEditor.onCreated(function() {
}).then(
function(isConfirm) {
if(isConfirm) {
Meteor.call('updatePage', template.pageName.get(), changedData, function (error, result) {
Meteor.call('updatePage', pageName, changedData, function (error, result) {
if (error) sAlert.error(error);
else sAlert.success("Content Saved Successfully");
});