-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to override LinkFormView? #4786
Comments
Well, we're back to the roots of the UI library here. The initial assumption was that views are interchangeable but we dropped the idea after a while because it meant a very complex architecture. I'd try to create a Perhaps it's possible to do it on the build-level? Like silently replace /cc @Reinmar |
It also depends on to what extent the new |
I need to change an order of child views and remove one container. So I'm afraid that I need a new template definition. |
Theoretically, I can try to hack this view by a CSS but I'm not sure if it is a right way. |
They're not in collections :(
Which one? Maybe this can be hacked with CSS. |
Now is: this.template = new Template( {
tag: 'form',
attributes: {
class: [
'ck-link-form',
]
},
children: [
this.urlInputView,
{
tag: 'div',
attributes: {
class: [
'ck-link-form__actions'
]
},
children: [
this.saveButtonView,
this.cancelButtonView,
this.unlinkButtonView
]
}
]
} ); I need: this.template = new Template( {
tag: 'form',
attributes: {
class: [
'ck-link-form',
]
},
children: [
this.unlinkButtonView
this.urlInputView,
this.saveButtonView,
this.cancelButtonView,
]
} ); |
I don't even need to change order of child for the FocysCycler. |
I replied regarding some aspects of this ticket in #425. |
I'll use webpack to replace this View. |
Could you post some example how you configured this under #425? |
I need to use Link plugin with a custom form view. Everything should work the same but View has to have a different markup. That's it. I see 2 ways to do it:
Link
class and change import ofLinkFormView
and also create a copy ofLinkFormView
and change template. Easy but produces a lot of duplicated code to maintenance. Eventually, we can splitLink
andLinkformView
into small helpers to reduce duplicated code.Link
andLinkFormView
classes to be available to extend and override. MakesLink#_createFormView
@protected
instead of@private
and moveLinkFormView
template definition fromconstructor
to@protected
method.Option 2 seems to be the easiest from my perspective.
The text was updated successfully, but these errors were encountered: