|
|
|
@ -34,16 +34,23 @@ define('admin/settings/email', ['admin/settings'], function(settings) {
|
|
|
|
|
emailEditor.setTheme("ace/theme/twilight");
|
|
|
|
|
emailEditor.getSession().setMode("ace/mode/html");
|
|
|
|
|
|
|
|
|
|
emailEditor.on('change', function(event) {
|
|
|
|
|
$('#email-editor-holder').val(emailEditor.getValue());
|
|
|
|
|
emailEditor.on('change', function() {
|
|
|
|
|
var emailPath = $('#email-editor-selector').val();
|
|
|
|
|
var original;
|
|
|
|
|
ajaxify.data.emails.forEach(function(email) {
|
|
|
|
|
if (email.path === emailPath) {
|
|
|
|
|
original = email.original;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
var newEmail = emailEditor.getValue();
|
|
|
|
|
$('#email-editor-holder').val(newEmail !== original ? newEmail : '');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$('button[data-action="email.revert"]').off('click').on('click', function() {
|
|
|
|
|
ajaxify.data.emails.forEach(function(email) {
|
|
|
|
|
if (email.path === $('#email-editor-selector').val()) {
|
|
|
|
|
emailEditor.getSession().setValue(email.original);
|
|
|
|
|
$('#email-editor-holder')
|
|
|
|
|
.val(email.original);
|
|
|
|
|
$('#email-editor-holder').val('');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
@ -56,7 +63,7 @@ define('admin/settings/email', ['admin/settings'], function(settings) {
|
|
|
|
|
if (email.path === $('#email-editor-selector').val()) {
|
|
|
|
|
emailEditor.getSession().setValue(email.text);
|
|
|
|
|
$('#email-editor-holder')
|
|
|
|
|
.val(email.text)
|
|
|
|
|
.val(email.text !== email.original ? email.text : '')
|
|
|
|
|
.attr('data-field', 'email:custom:' + email.path);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|