mirror of
https://github.com/sparksuite/simplemde-markdown-editor.git
synced 2024-06-01 21:42:28 +02:00
simplify createTootlip
This commit is contained in:
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 actionName = void 0;
|
||||
var tooltip = title;
|
||||
|
||||
if (action) {
|
||||
actionName = _utils2.default.getBindingName(action);
|
||||
if (shortcuts[actionName]) {
|
||||
tooltip += " (" + _utils2.default.fixShortcut(shortcuts[actionName]) + ")";
|
||||
}
|
||||
if (!action) return title;
|
||||
var actionName = _utils2.default.getBindingName(action);
|
||||
if (shortcuts[actionName]) {
|
||||
title += ' ( ' + _utils2.default.fixShortcut(shortcuts[actionName]) + ' )';
|
||||
}
|
||||
|
||||
return tooltip;
|
||||
return title;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -16812,9 +16808,8 @@ var SimpleMDE = function (_Action) {
|
|||
_utils2.default.downloadFA(options);
|
||||
|
||||
// Find the textarea to use
|
||||
if (options.element) {
|
||||
_this.element = options.element;
|
||||
} else if (options.element === null) {
|
||||
if (options.element) _this.element = options.element;
|
||||
if (options.element === null) {
|
||||
var _ret;
|
||||
|
||||
// This means that the element option was specified, but no element was found
|
||||
|
|
2
dist/simplemde.min.js
vendored
2
dist/simplemde.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -53,17 +53,13 @@ const createSep = () => {
|
|||
}
|
||||
|
||||
const createTootlip = (title, action, shortcuts) => {
|
||||
let actionName;
|
||||
let tooltip = title;
|
||||
|
||||
if(action) {
|
||||
actionName = utils.getBindingName(action);
|
||||
if(shortcuts[actionName]) {
|
||||
tooltip += " (" + utils.fixShortcut(shortcuts[actionName]) + ")";
|
||||
}
|
||||
if(!action) return title
|
||||
const actionName = utils.getBindingName(action);
|
||||
if(shortcuts[actionName]) {
|
||||
title += ` ( ${utils.fixShortcut(shortcuts[actionName])} )`
|
||||
}
|
||||
|
||||
return tooltip;
|
||||
return title;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -80,9 +76,8 @@ class SimpleMDE extends Action {
|
|||
utils.downloadFA(options)
|
||||
|
||||
// Find the textarea to use
|
||||
if(options.element) {
|
||||
this.element = options.element;
|
||||
} else if(options.element === null) {
|
||||
if(options.element) this.element = options.element;
|
||||
if(options.element === null) {
|
||||
// This means that the element option was specified, but no element was found
|
||||
return console.log("SimpleMDE: Error. No element was found.");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue