Skip to content

Node.js based forum software built for the modern web

adding a confirm dialog behind the theme revert button in the acp

Julian Lam41187dfddbdd
diff --git a/public/src/forum/admin/themes.js b/public/src/forum/admin/themes.js
index 770d6e8452..76c50c2900 100644
--- a/public/src/forum/admin/themes.js
+++ b/public/src/forum/admin/themes.js
@@ -58,7 +58,11 @@ nodebb_admin.themes = {
var revertEl = document.getElementById('revert_theme');
revertEl.addEventListener('click', function() {
- nodebb_admin.remove('theme:id');
- nodebb_admin.remove('theme:src');
+ bootbox.confirm('Are you sure you wish to remove the custom theme and restore the NodeBB default theme?', function(confirm) {
+ if (confirm) {
+ nodebb_admin.remove('theme:id');
+ nodebb_admin.remove('theme:src');
+ }
+ });
}, false);
})();
\ No newline at end of file
diff --git a/public/templates/admin/footer.tpl b/public/templates/admin/footer.tpl
index f780eb6fe2..3b10c74e8e 100644
--- a/public/templates/admin/footer.tpl
+++ b/public/templates/admin/footer.tpl
@@ -11,7 +11,6 @@
prepare: function() {
// Come back in 500ms if the config isn't ready yet
if (nodebb_admin.config === undefined) {
- console.log('Config not ready...');
setTimeout(function() {
nodebb_admin.prepare();
}, 500);
@@ -71,9 +70,6 @@
}
});
},
- // save: function(key, value) {
- // socket.emit('api:config.set', { key: key, value: value });
- // },
remove: function(key) {
socket.emit('api:config.remove', key);
}