mirror of
https://github.com/sparksuite/simplemde-markdown-editor.git
synced 2024-06-09 01:12:14 +02:00
optimal traversal
This commit is contained in:
parent
ef0d99728b
commit
5030bb7522
File diff suppressed because one or more lines are too long
|
@ -360,7 +360,7 @@ export default class Action {
|
|||
});
|
||||
}
|
||||
|
||||
for (var i = block_start; i <= block_end; i++){
|
||||
for (let i = block_start; i <= block_end; i++){
|
||||
cm.indentLine(i, "subtract"); // TODO: this doesn't get tracked in the history, so can't be undone :(
|
||||
}
|
||||
cm.focus();
|
||||
|
|
|
@ -87,7 +87,7 @@ class SimpleMDE extends Action {
|
|||
options.toolbar = [];
|
||||
|
||||
// Loop over the built in buttons, to get the preferred order
|
||||
for(let key in toolbarBuiltInButtons) {
|
||||
for(const key in toolbarBuiltInButtons) {
|
||||
if(toolbarBuiltInButtons.hasOwnProperty(key)) {
|
||||
if(key.indexOf("separator-") != -1) {
|
||||
options.toolbar.push("|");
|
||||
|
@ -176,7 +176,7 @@ class SimpleMDE extends Action {
|
|||
const self = this;
|
||||
let keyMaps = {};
|
||||
|
||||
for(let key in options.shortcuts) {
|
||||
for(const key in options.shortcuts) {
|
||||
// null stands for "do not bind this command"
|
||||
if(options.shortcuts[key] !== null && bindings[key] !== null) {
|
||||
keyMaps[utils.fixShortcut(options.shortcuts[key])] = () => bindings[key](self);
|
||||
|
@ -406,7 +406,7 @@ class SimpleMDE extends Action {
|
|||
this.codemirror.on("cursorActivity", () => {
|
||||
let stat = base.getState(this.codemirror);
|
||||
|
||||
for(let key in toolbarData) {
|
||||
for(const key in toolbarData) {
|
||||
(function(key) {
|
||||
let el = toolbarData[key];
|
||||
if(stat[key]) {
|
||||
|
|
|
@ -37,7 +37,7 @@ export default new class Utils {
|
|||
}
|
||||
|
||||
getBindingName (f){
|
||||
for(let key in bindings) {
|
||||
for(const key in bindings) {
|
||||
if(bindings[key] === f) {
|
||||
return key;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue