From 27ebda9dae0f6736aea85dc8309f9dd84cebe145 Mon Sep 17 00:00:00 2001 From: bobzel Date: Thu, 27 Aug 2020 23:59:42 -0400 Subject: added button for creating tabs in header bar. fixed runtimemissing icon errors --- src/client/views/collections/CollectionDockingView.scss | 6 +++++- src/client/views/collections/CollectionDockingView.tsx | 15 +++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) (limited to 'src/client/views/collections') diff --git a/src/client/views/collections/CollectionDockingView.scss b/src/client/views/collections/CollectionDockingView.scss index 6ebd5103b..f1a29bd13 100644 --- a/src/client/views/collections/CollectionDockingView.scss +++ b/src/client/views/collections/CollectionDockingView.scss @@ -69,7 +69,7 @@ } .lm_popout { - display: none; + display: inline; } .messageCounter { @@ -119,6 +119,10 @@ transform: scale(1.2); } + .lm_controls .lm_popout { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAUCAAAAABHICnvAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QAAKqNIzIAAAAHdElNRQfkCBsXMgbrEyzaAAAAT0lEQVQY02NgIAcIu8tgEW3/u4IDQ5B14/8LQlhFhckVFfCJjIyIOfP/QWpEZGSQJFS05s9fIPj3/z+YmseCTxS7CZS7DI+PsYcOjpAkDAA6H0KZxzDzlgAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMC0wOC0yN1QyMzo1MDowNi0wNDowMDvgVpQAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjAtMDgtMjdUMjM6NTA6MDYtMDQ6MDBKve4oAAAAAElFTkSuQmCC) + } + .lm_maximised .lm_controls .lm_maximise { opacity: 1; transform: scale(0.8); diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx index 003f0c514..3d8ac2a23 100644 --- a/src/client/views/collections/CollectionDockingView.tsx +++ b/src/client/views/collections/CollectionDockingView.tsx @@ -642,7 +642,7 @@ export class CollectionDockingView extends CollectionSubView(doc => doc) { stack.layoutManager.on("activeContentItemChanged", this.stackActiveChanged); //stack.header.controlsContainer.find('.lm_popout').hide(); stack.header.element.on('mousedown', (e: any) => { - if (e.target === stack.header.element[0] && e.button === 1) { + if (e.target === stack.header.element[0] && e.button === 2) { const emptyPane = Cast(Doc.UserDoc().emptyPane, Doc, null); emptyPane["dragFactory-count"] = NumCast(emptyPane["dragFactory-count"]) + 1; this.AddTab(stack, Docs.Create.FreeformDocument([], { @@ -674,7 +674,7 @@ export class CollectionDockingView extends CollectionSubView(doc => doc) { // }); stack.header.controlsContainer.find('.lm_close') //get the close icon .off('click') //unbind the current click handler - .click(action(async function () { + .click(action(async () => { //if (confirm('really close this?')) { stack.remove(); @@ -692,8 +692,15 @@ export class CollectionDockingView extends CollectionSubView(doc => doc) { })); stack.header.controlsContainer.find('.lm_popout') //get the close icon .off('click') //unbind the current click handler - .click(action(function () { - stack.config.fixed = !stack.config.fixed; + .click(action(() => { + // stack.config.fixed = !stack.config.fixed; // force the stack to have a fixed size + + const emptyPane = Cast(Doc.UserDoc().emptyPane, Doc, null); + emptyPane["dragFactory-count"] = NumCast(emptyPane["dragFactory-count"]) + 1; + this.AddTab(stack, Docs.Create.FreeformDocument([], { + _width: this.props.PanelWidth(), _height: this.props.PanelHeight(), title: `Untitled Tab ${NumCast(emptyPane["dragFactory-count"])}` + })); + // const url = Utils.prepend("/doc/" + stack.contentItems[0].tab.contentItem.config.props.documentId); // let win = window.open(url, stack.contentItems[0].tab.title, "width=300,height=400"); })); -- cgit v1.2.3-70-g09d2