Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/legacy/js/functions/_editAlert.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ function editAlert(collectionId, data, templateData, field, idField) {
initialiseAlert(collectionId, data, templateData, field, idField);
// New alert
$("#add-" + idField).click(function () {
// Block add if content has migration link
if (blockNonMigrationChangeWithWarning()) {
return;
}
if (!data[field]) {
data[field] = [];
templateData[field] = [];
Expand Down Expand Up @@ -45,6 +49,10 @@ function initialiseAlert(collectionId, data, templateData, field, idField) {
templateData[field][index].date = new Date($('#date_' + index).datepicker('getDate')).toISOString();
});
$('#' + idField + '-edit_' + index).click(function () {
// Block edit if content has migration link
if (blockNonMigrationChangeWithWarning()) {
return;
}
var editedSectionValue = {title: 'Alert notice', markdown: data[field][index].markdown};
//var editedSectionValue = data[field][index].markdown;
var saveContent = function (updatedContent) {
Expand Down Expand Up @@ -79,6 +87,10 @@ function initialiseAlert(collectionId, data, templateData, field, idField) {

// Delete
$('#' + idField + '-delete_' + index).click(function () {
// Block delete if content has migration link
if (blockNonMigrationChangeWithWarning()) {
return;
}
swal ({
title: "Warning",
text: "Are you sure you want to delete this alert?",
Expand Down
12 changes: 12 additions & 0 deletions src/legacy/js/functions/_editDocumentCorrection.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ function editDocumentCorrection(collectionId, data, templateData, field, idField
initialiseCorrection(collectionId, data, templateData, field, idField);
// New correction
$("#add-" + idField).one('click', function () {
// Block add if content has migration link
if (blockNonMigrationChangeWithWarning()) {
return;
}
if (!data[field]) {
data[field] = [];
templateData[field] = [];
Expand Down Expand Up @@ -127,6 +131,10 @@ function initialiseCorrection(collectionId, data, templateData, field, idField)


$('#' + idField + '-edit_' + index).click(function () {
// Block edit if content has migration link
if (blockNonMigrationChangeWithWarning()) {
return;
}
var markdown = data[field][index].correctionNotice;
var editedSectionValue = {title: 'Correction notice', markdown: markdown};
var saveContent = function (updatedContent) {
Expand All @@ -138,6 +146,10 @@ function initialiseCorrection(collectionId, data, templateData, field, idField)
});
// Delete
$('#' + idField + '-delete_' + index).click(function () {
// Block delete if content has migration link
if (blockNonMigrationChangeWithWarning()) {
return;
}
swal ({
title: "Warning",
text: "Are you sure you want to delete this correction?",
Expand Down
12 changes: 12 additions & 0 deletions src/legacy/js/functions/_t7StaticLandingPageEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ function staticLandingPageEditor(collectionId, data) {
}

$("#section-edit_" + index).click(function () {
// Block edit if content has migration link
if (blockNonMigrationChangeWithWarning()) {
return;
}
var editedSectionValue = {
"title": $('#section-title_' + index).val(),
"markdown": $("#section-markdown_" + index).val()
Expand All @@ -101,6 +105,10 @@ function staticLandingPageEditor(collectionId, data) {

// Delete
$("#section-delete_" + index).click(function () {
// Block delete if content has migration link
if (blockNonMigrationChangeWithWarning()) {
return;
}
swal({
title: "Warning",
text: "Are you sure you want to delete?",
Expand Down Expand Up @@ -156,6 +164,10 @@ function staticLandingPageEditor(collectionId, data) {

//Add new content
$("#add-section").one('click', function () {
// Block add if content has migration link
if (blockNonMigrationChangeWithWarning()) {
return;
}
swal({
title: "Warning",
text: "If you do not come back to this page, you will lose any unsaved changes",
Expand Down
Loading