avoid negative conditionals

pull/510/head
WittBulter 7 years ago
parent 2e43015094
commit 6a932ef300

File diff suppressed because one or more lines are too long

@ -15872,7 +15872,7 @@ var Action = function () {
// Hide side by side if needed
var sidebyside = cm.getWrapperElement().nextSibling;
if (/editor-preview-active-side/.test(sidebyside.className)) Action.toggleSideBySide(editor);
if (/editor-preview-active-side/.test(sidebyside.className)) this.toggleSideBySide(editor);
}
/**
@ -15882,6 +15882,8 @@ var Action = function () {
}, {
key: 'toggleSideBySide',
value: function toggleSideBySide(editor) {
var _this = this;
var cm = editor.codemirror;
var wrapper = cm.getWrapperElement();
var preview = wrapper.nextSibling;
@ -15896,7 +15898,7 @@ var Action = function () {
// give some time for the transition from editor.css to fire and the view to slide from right to left,
// instead of just appearing.
setTimeout(function () {
if (!cm.getOption("fullScreen")) Action.toggleFullScreen(editor);
if (!cm.getOption("fullScreen")) _this.toggleFullScreen(editor);
preview.className += " editor-preview-active-side";
}, 1);
toolbarButton.className += " active";
@ -15974,7 +15976,7 @@ var Action = function () {
// Turn off side by side if needed
var sidebyside = cm.getWrapperElement().nextSibling;
if (/editor-preview-active-side/.test(sidebyside.className)) Action.toggleSideBySide(editor);
if (/editor-preview-active-side/.test(sidebyside.className)) this.toggleSideBySide(editor);
}
/**
@ -16070,6 +16072,11 @@ var Action = function () {
cm.redo();
cm.focus();
}
}, {
key: 'openGuide',
value: function openGuide() {
window.open('https://simplemde.com/markdown-guide');
}
}]);
return Action;
@ -16643,7 +16650,7 @@ var toolbarBuiltInButtons = exports.toolbarBuiltInButtons = {
},
"guide": {
name: "guide",
action: "https://simplemde.com/markdown-guide",
action: "openGuide",
className: "fa fa-question-circle",
title: "Markdown Guide",
default: true
@ -17168,12 +17175,6 @@ var SimpleMDE = function (_Action) {
isCustomMethods ? v.action(_this3) : _get(SimpleMDE.prototype.__proto__ || Object.getPrototypeOf(SimpleMDE.prototype), v.action, _this3).call(_this3, _this3);
};
}
// Link can be converted to a function
// todo
// if(typeof v.action === "string") {
// el.href = v.action;
// el.target = "_blank";
// }
toolbarData[v.name || v] = el;
bar.appendChild(el);
@ -17181,7 +17182,6 @@ var SimpleMDE = function (_Action) {
this.toolbarElements = toolbarData;
this.codemirror.on("cursorActivity", function () {
var stat = _base2.default.getState(_this3.codemirror);
console.log(toolbarData, 1);
for (var key in toolbarData) {
var el = toolbarData[key];
if (stat[key]) {

File diff suppressed because one or more lines are too long

@ -417,7 +417,7 @@ export default class Action {
// Hide side by side if needed
const sidebyside = cm.getWrapperElement().nextSibling;
if (/editor-preview-active-side/.test(sidebyside.className))
Action.toggleSideBySide(editor);
this.toggleSideBySide(editor);
}
@ -442,7 +442,7 @@ export default class Action {
// instead of just appearing.
setTimeout(() =>{
if (!cm.getOption("fullScreen"))
Action.toggleFullScreen(editor);
this.toggleFullScreen(editor);
preview.className += " editor-preview-active-side";
}, 1);
toolbarButton.className += " active";
@ -520,7 +520,7 @@ export default class Action {
// Turn off side by side if needed
const sidebyside = cm.getWrapperElement().nextSibling;
if (/editor-preview-active-side/.test(sidebyside.className))
Action.toggleSideBySide(editor);
this.toggleSideBySide(editor);
}
/**
@ -594,5 +594,9 @@ export default class Action {
cm.focus();
}
openGuide (){
window.open('https://simplemde.com/markdown-guide')
}
}

@ -197,7 +197,7 @@ export const toolbarBuiltInButtons = {
},
"guide": {
name: "guide",
action: "https://simplemde.com/markdown-guide",
action: "openGuide",
className: "fa fa-question-circle",
title: "Markdown Guide",
default: true

@ -391,12 +391,6 @@ class SimpleMDE extends Action {
isCustomMethods ? v.action(this) : super[v.action](this)
};
}
// Link can be converted to a function
// todo
// if(typeof v.action === "string") {
// el.href = v.action;
// el.target = "_blank";
// }
toolbarData[v.name || v] = el;
bar.appendChild(el);

Loading…
Cancel
Save