Skip to content
Snippets Groups Projects
Commit da82428e authored by rhenck's avatar rhenck
Browse files

Improve button defaults in cloze context

- Also simplify the button constructor
parent 54ab9bf7
No related branches found
No related tags found
No related merge requests found
Pipeline #41881 passed
......@@ -24,9 +24,7 @@ export class ButtonElement extends UIElement {
if (element.action) this.action = element.action;
if (element.actionParam) this.actionParam = element.actionParam;
this.position = element.position ? UIElement.initPositionProps(element.position) : undefined;
this.styling = {
...UIElement.initStylingProps<{ borderRadius: number; }>({ borderRadius: 0, ...element.styling })
};
this.styling = UIElement.initStylingProps({ borderRadius: 0, ...element.styling });
}
getElementComponent(): Type<ElementComponent> {
......
......@@ -3,6 +3,7 @@ import { Node, mergeAttributes } from '@tiptap/core';
import { AngularNodeViewRenderer } from 'ngx-tiptap';
import { ButtonElement } from 'common/models/elements/button/button';
import { ButtonNodeviewComponent } from 'editor/src/app/text-editor/angular-node-views/button-nodeview.component';
import { BasicStyles } from 'common/models/elements/element';
const ButtonComponentExtension = (injector: Injector): Node => {
return Node.create({
......@@ -13,7 +14,15 @@ const ButtonComponentExtension = (injector: Injector): Node => {
addAttributes() {
return {
model: {
default: new ButtonElement({ type: 'button', id: 'cloze-child-id-placeholder', height: 34 })
default: new ButtonElement({
type: 'button',
id: 'cloze-child-id-placeholder',
height: 34,
asLink: true,
styling: {
backgroundColor: 'transparent'
} as BasicStyles & { borderRadius: number; }
})
}
};
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment