-
Notifications
You must be signed in to change notification settings - Fork 1
Conversation
…e content is not shown correctly and tabs cannot be switched, since event listeners are not copied
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation-wise it looks fine. However, I would add a margin between title and the expand/compress icon or move the icon left to the close button.
yes, the margin is still an issue further changes I'll make:
|
Your suggested changes sound good to me. |
very nice, looks great! |
src/layout/interfaces.ts
Outdated
@@ -19,7 +19,7 @@ export class LayoutContainerEvents { | |||
static readonly EVENT_TAB_REORDED = 'tabReorded'; | |||
static readonly EVENT_CHANGE_ACTIVE_TAB = 'changeActiveTab'; | |||
static readonly EVENT_MAXIMIZE = 'maximize'; | |||
static readonly EVENT_MINIMIZE = 'minimize'; | |||
static readonly RESTORE_SIZE = 'restoreSize'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't you keep the EVENT_
at the beginning of the variable name?
constructor(document: Document, public readonly build: (layout: IBuildAbleOrViewLike)=> ILayoutContainer, private readonly restorer: (dump: ILayoutDump, restoreView: (referenceId: number) => IView) => ILayoutContainer) { | ||
super(document, { | ||
name: '', | ||
fixed: true | ||
}); | ||
this.node.dataset.layout = 'root'; | ||
this.visible = true; | ||
|
||
this.on(LayoutContainerEvents.EVENT_MAXIMIZE, (evt) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prefer: `_evt, view'
// maximize views | ||
const view = evt.args[0]; | ||
|
||
const section = document.createElement('section'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prefer: this.node.ownerDocument.createElement
@@ -18,6 +18,8 @@ export default class ViewLayoutContainer extends ALayoutContainer<IViewLayoutCon | |||
this.node.dataset.layout = 'view'; | |||
this.node.appendChild(view.node); | |||
|
|||
this.header.insertAdjacentHTML('beforeend', `<button type="button" title="Expand view" class="size-toggle ${this.options.fixed ? 'hidden' : ''}" aria-label="Toggle View Size"><span><i class="fa fa-expand"></i></span></button>`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when the layout is fixed, I cannot maximize the view?
…iew dump instead of view.parent since it could be organized differently and therefore the nodes would be added somewhere else
closes #51