Skip to content
Snippets Groups Projects
Commit 18edfd51 authored by aydreeihn's avatar aydreeihn
Browse files

Merge remote-tracking branch 'kevin/issue/reset-button' into features_prs/develop-next

parents 9263109d 6b639d6f
Branches
Tags
No related merge requests found
...@@ -94,6 +94,7 @@ RedactorPlugins.draft = function() { ...@@ -94,6 +94,7 @@ RedactorPlugins.draft = function() {
// No change yet — dont't show the button // No change yet — dont't show the button
return; return;
} }
this.$box.find('textarea').attr('data-draft-id', this.opts.draftId);
if (data && this.code.get()) { if (data && this.code.get()) {
this.$draft_saved.show().delay(5000).fadeOut(); this.$draft_saved.show().delay(5000).fadeOut();
} }
...@@ -290,10 +291,10 @@ $(function() { ...@@ -290,10 +291,10 @@ $(function() {
var reset = $('input[type=reset]', el.closest('form')); var reset = $('input[type=reset]', el.closest('form'));
if (reset) { if (reset) {
reset.click(function() { reset.click(function() {
if (el.hasClass('draft')) if (el.attr('data-draft-id'))
el.redactor('deleteDraft'); el.redactor('draft.deleteDraft').attr('data-draft-id', '');
else else
el.redactor('set', '', false, false); el.redactor('insert.set', '', false, false);
}); });
} }
$('input[type=submit]', el.closest('form')).on('click', function() { $('input[type=submit]', el.closest('form')).on('click', function() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment