mirror of
https://github.com/sparksuite/simplemde-markdown-editor.git
synced 2025-09-24 16:40:55 -06: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 createTootlip = function createTootlip(title, action, shortcuts) {
|
||||||
var actionName = void 0;
|
if (!action) return title;
|
||||||
var tooltip = title;
|
var actionName = _utils2.default.getBindingName(action);
|
||||||
|
|
||||||
if (action) {
|
|
||||||
actionName = _utils2.default.getBindingName(action);
|
|
||||||
if (shortcuts[actionName]) {
|
if (shortcuts[actionName]) {
|
||||||
tooltip += " (" + _utils2.default.fixShortcut(shortcuts[actionName]) + ")";
|
title += ' ( ' + _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
|
||||||
|
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) => {
|
const createTootlip = (title, action, shortcuts) => {
|
||||||
let actionName;
|
if(!action) return title
|
||||||
let tooltip = title;
|
const actionName = utils.getBindingName(action);
|
||||||
|
|
||||||
if(action) {
|
|
||||||
actionName = utils.getBindingName(action);
|
|
||||||
if(shortcuts[actionName]) {
|
if(shortcuts[actionName]) {
|
||||||
tooltip += " (" + utils.fixShortcut(shortcuts[actionName]) + ")";
|
title += ` ( ${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…
x
Reference in New Issue
Block a user