From 1837d697f5d87567374f37c7f1e23c233a58fc49 Mon Sep 17 00:00:00 2001 From: Dmitry Mazurov Date: Thu, 9 Apr 2020 18:07:16 +0300 Subject: [PATCH] Update toolbar titles Signed-off-by: Dmitry Mazurov --- src/js/easymde.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/js/easymde.js b/src/js/easymde.js index 550895f..f965566 100644 --- a/src/js/easymde.js +++ b/src/js/easymde.js @@ -1656,6 +1656,9 @@ function EasyMDE(options) { options.autosave.timeFormat = extend({}, timeFormat, options.autosave.timeFormat || {}); } + // Merging the toolbar title, with the given options + toolbarBuiltInButtons = extend({}, toolbarBuiltInButtons, options.toolbarTitles || {}); + // Merging the shortcuts, with the given options options.shortcuts = extend({}, shortcuts, options.shortcuts || {}); @@ -2279,11 +2282,7 @@ EasyMDE.prototype.createToolbar = function (items) { var i; for (i = 0; i < items.length; i++) { if (toolbarBuiltInButtons[items[i]] != undefined) { - if (this.options.toolbarTitles != undefined && this.options.toolbarTitles[items[i]] != undefined) { - items[i] = extend({}, toolbarBuiltInButtons[items[i]], this.options.toolbarTitles[items[i]]); - } else { - items[i] = toolbarBuiltInButtons[items[i]]; - } + items[i] = toolbarBuiltInButtons[items[i]]; } }