simplify createTootlip

pull/510/head
WittBulter 7 years ago
parent 2c2d775a6b
commit 03a698cb35

File diff suppressed because one or more lines are too long

@ -16778,17 +16778,13 @@ var createSep = function createSep() {
}; };
var createTootlip = function createTootlip(title, action, shortcuts) { var createTootlip = function createTootlip(title, action, shortcuts) {
var actionName = void 0; if (!action) return title;
var tooltip = title; var actionName = _utils2.default.getBindingName(action);
if (shortcuts[actionName]) {
if (action) { title += ' ( ' + _utils2.default.fixShortcut(shortcuts[actionName]) + ' )';
actionName = _utils2.default.getBindingName(action);
if (shortcuts[actionName]) {
tooltip += " (" + _utils2.default.fixShortcut(shortcuts[actionName]) + ")";
}
} }
return tooltip; return title;
}; };
/** /**
@ -16812,9 +16808,8 @@ var SimpleMDE = function (_Action) {
_utils2.default.downloadFA(options); _utils2.default.downloadFA(options);
// Find the textarea to use // Find the textarea to use
if (options.element) { if (options.element) _this.element = options.element;
_this.element = options.element; if (options.element === null) {
} else if (options.element === null) {
var _ret; var _ret;
// This means that the element option was specified, but no element was found // This means that the element option was specified, but no element was found

File diff suppressed because one or more lines are too long

@ -53,17 +53,13 @@ const createSep = () => {
} }
const createTootlip = (title, action, shortcuts) => { const createTootlip = (title, action, shortcuts) => {
let actionName; if(!action) return title
let tooltip = title; const actionName = utils.getBindingName(action);
if(shortcuts[actionName]) {
if(action) { title += ` ( ${utils.fixShortcut(shortcuts[actionName])} )`
actionName = utils.getBindingName(action);
if(shortcuts[actionName]) {
tooltip += " (" + utils.fixShortcut(shortcuts[actionName]) + ")";
}
} }
return tooltip; return title;
} }
/** /**
@ -80,9 +76,8 @@ class SimpleMDE extends Action {
utils.downloadFA(options) utils.downloadFA(options)
// Find the textarea to use // Find the textarea to use
if(options.element) { if(options.element) this.element = options.element;
this.element = options.element; if(options.element === null) {
} else if(options.element === null) {
// This means that the element option was specified, but no element was found // This means that the element option was specified, but no element was found
return console.log("SimpleMDE: Error. No element was found."); return console.log("SimpleMDE: Error. No element was found.");
} }

Loading…
Cancel
Save