Skip to content

Commit 4681a96

Browse files
committed
Clean up
1 parent 4e389d3 commit 4681a96

File tree

4 files changed

+6
-25
lines changed

4 files changed

+6
-25
lines changed

dist/js/les-mills-class-types.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/js/LesMillsClassTypes.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,7 @@ export const LesMillsClassTypes = Mark.create({
3737
addCommands() {
3838
return {
3939
setClassType: (attributes) => ({ commands }) => {
40-
console.log(attributes);
4140
return commands.toggleMark(this.name, attributes);
42-
if (attrs.key) {
43-
return commands.updateAttributes(this.type, attrs)
44-
}
45-
46-
return commands.unsetMark(type)
4741
}
4842
}
4943
},

resources/js/LesMillsClassTypesMenu.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@ export default {
6060
}
6161
};
6262
},
63+
6364
currentKey() {
64-
return '';
65-
return this.editor.getMarkAttrs('lesMillsClassType').key;
65+
// get the lesMillsClassType attribute
66+
return this.editor.getAttributes('lesMillsClassType').key;
6667
}
6768
},
6869
data() {
@@ -78,7 +79,7 @@ export default {
7879
setClassType(classTypeKey) {
7980
// update the editor
8081
this.editor.commands.setClassType({
81-
key: classTypeKey == this.currentKey ? false : classTypeKey
82+
key: classTypeKey === this.currentKey ? false : classTypeKey
8283
})
8384
8485
// hide the menu

resources/js/bard.js

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,10 @@ Statamic.$bard.buttons((buttons, button) => {
66
return button({
77
name: 'lesmillsclass',
88
text: 'Les Mills Class Type',
9-
//command: (editor) => editor.chain().focus().setClassType().run(),
10-
command: 'setClassType',
119
args: {
1210
key: ""
1311
},
1412
html: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewbox="0 0 24 24" fill="currentColor"><path d="M7.6 17.295c-.03.32.22.76.65.76H22.5l-.76 4.82H3.87c-1.76 0-2.47-1.6-2.36-2.58l2.93-19.17h5.58l-2.41 16.17"/></svg>',
1513
component: LesMillsClassTypesMenu
1614
});
17-
});
18-
/*Statamic.$bard.buttons(() => {
19-
return {
20-
name: 'lesmillsclass',
21-
text: 'Les Mills Class Type',
22-
command: 'classType',
23-
args: {
24-
key: ""
25-
},
26-
icon: 'les-mills',
27-
component: LesMillsClassTypesMenu
28-
};
29-
});*/
15+
});

0 commit comments

Comments
 (0)