Skip to content

Commit

Permalink
Enable drag-and-drop by default (#440)
Browse files Browse the repository at this point in the history
  • Loading branch information
vslinko authored May 9, 2023
1 parent c3a9dc8 commit 69b5f13
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
12 changes: 6 additions & 6 deletions specs/features/DragAndDrop.spec.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# list should move after dragging it with the mouse

- setting: `dndExperiment=true`
- setting: `dnd=true`
- applyState:

```md
Expand All @@ -22,7 +22,7 @@

# list should move with sublists after dragging it with the mouse

- setting: `dndExperiment=true`
- setting: `dnd=true`
- applyState:

```md
Expand All @@ -46,7 +46,7 @@

# cursor should keep position after moving the list

- setting: `dndExperiment=true`
- setting: `dnd=true`
- applyState:

```md
Expand All @@ -68,7 +68,7 @@

# list should move to the first position if the mouse is moved above all items

- setting: `dndExperiment=true`
- setting: `dnd=true`
- applyState:

```md
Expand All @@ -90,7 +90,7 @@

# list should move to the last position if the mouse is moved below all items

- setting: `dndExperiment=true`
- setting: `dnd=true`
- applyState:

```md
Expand Down Expand Up @@ -118,7 +118,7 @@

# list should move inside another list if the mouse is moved slightly to the right

- setting: `dndExperiment=true`
- setting: `dnd=true`
- applyState:

```md
Expand Down
12 changes: 5 additions & 7 deletions src/features/SettingsTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,12 @@ class ObsidianOutlinerPluginSettingTab extends PluginSettingTab {
});
});

new Setting(containerEl)
.setName("Drag-and-Drop (Experimental)")
.addToggle((toggle) => {
toggle.setValue(this.settings.dragAndDrop).onChange(async (value) => {
this.settings.dragAndDrop = value;
await this.settings.save();
});
new Setting(containerEl).setName("Drag-and-Drop").addToggle((toggle) => {
toggle.setValue(this.settings.dragAndDrop).onChange(async (value) => {
this.settings.dragAndDrop = value;
await this.settings.save();
});
});

new Setting(containerEl)
.setName("Debug mode")
Expand Down
8 changes: 4 additions & 4 deletions src/services/Settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface SettingsObject {
selectAll: boolean;
listLines: boolean;
listLineAction: VerticalLinesAction;
dndExperiment: boolean;
dnd: boolean;
previousRelease: string | null;
}

Expand All @@ -26,7 +26,7 @@ const DEFAULT_SETTINGS: SettingsObject = {
selectAll: true,
listLines: false,
listLineAction: "toggle-folding",
dndExperiment: false,
dnd: true,
previousRelease: null,
};

Expand Down Expand Up @@ -111,11 +111,11 @@ export class Settings {
}

get dragAndDrop() {
return this.values.dndExperiment;
return this.values.dnd;
}

set dragAndDrop(value: boolean) {
this.set("dndExperiment", value);
this.set("dnd", value);
}

get debug() {
Expand Down

0 comments on commit 69b5f13

Please sign in to comment.