mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-18 05:22:48 +01:00
#1642 show discard prompt
This commit is contained in:
@@ -26,7 +26,20 @@ define('composer', [
|
||||
var env = utils.findBootstrapEnvironment();
|
||||
|
||||
if (composer.active && (env === 'xs' || env ==='sm')) {
|
||||
discard(composer.active);
|
||||
if (!composer.posts[composer.active].modified) {
|
||||
discard(composer.active);
|
||||
return;
|
||||
}
|
||||
|
||||
translator.translate('[[modules:composer.discard]]', function(translated) {
|
||||
bootbox.confirm(translated, function(confirm) {
|
||||
if (confirm) {
|
||||
discard(composer.active);
|
||||
} else {
|
||||
history.pushState({}, '', '#compose');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user