Skip to content
This repository has been archived by the owner on Jul 12, 2020. It is now read-only.

Panel: Add popup window button #27

Merged
merged 2 commits into from
May 24, 2018
Merged

Conversation

yamgent
Copy link
Member

@yamgent yamgent commented May 21, 2018

What is the purpose of this pull request? (put "X" next to an item, remove the rest)

• [X] New feature

Resolves MarkBind/markbind#225

What is the rationale for this request?
User wants a way to add popup windows for panels.

What changes did you make? (Give an overview)

  • Add a popup window button to the Panel.
  • Gave Panel a new attribute popup-url, which when specified, will be the URL that the popup window button navigates to.

Provide a demo:
popup

Is there anything you'd like reviewers to focus on?
The description of the new button in the documentation.

Testing instructions:

  1. Navigate to the panel that has the popup window button enabled.
  2. Click on the button. A new window should appear.

@yamgent yamgent changed the title Panel: Add popup button Panel: Add popup window button May 21, 2018
@damithc
Copy link

damithc commented May 21, 2018

I guess you'll be adding a way to disable it too? we have no-close etc. for other buttons.

@yamgent
Copy link
Member Author

yamgent commented May 21, 2018

I guess you'll be adding a way to disable it too? we have no-close etc. for other buttons.

Unlike the close and expand button, which is enabled by default, the popup button isn't enabled by default (because it relies on a provided URL for the popup to work, and by default such URL is not provided).

@acjh
Copy link

acjh commented May 21, 2018

Let's not reuse the term "popup", since this is very different from the Popup component.

Edit:
The component is Popover. "popup" is still not quite "new window/tab", but I guess it's fine.

Copy link

@Chng-Zhi-Xuan Chng-Zhi-Xuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feature works great, just need to focus on clarity and wording to Users.

<p>popup-url</p>
<p><code>String</code></p>
<p></p>
<p>The url to display in the popup window.</p>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should highlight to the User that either a remote web url or local directory path can be given.

@@ -95,6 +95,20 @@
<doc-code language="markup">
<panel header="Dynamic Loading" src="/docs/loadContent.html#fragment" minimized></panel>
</doc-code>
<br>

<h4>If <code>popup-url</code> attribute is provided, the panel shows a popup button, which when clicked, opens a new window to the specified url.</h4>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion:
" ... is provided, a popup button will be displayed. Upon clicking, it opens a new window to the contents of the specified url or directory path."

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's actually still an (absolute, root-relative or relative) URL.

<div class="bs-example">
<panel header="Some panel" popup-url="/docs/loadContent.html">
This panel has a popup.
</panel>
</div>
<doc-code language="markup">
<panel header="Some panel" popup-url="/docs/loadContent.html">
...
<div class="."></div>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, my apologies, not intentional (not sure how it got there, WebStorm expanded it? :P)

@yamgent
Copy link
Member Author

yamgent commented May 21, 2018

Minor error in the documentation fixed.

src/Panel.vue Outdated
@@ -34,6 +34,10 @@
@click.stop="close()">
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
</button>
<button type="button" class="popup-button btn btn-default"
v-show="this.popupUrl !== null" @click.stop="openPopup()">
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@click.stop on new line.

<p><code>String</code></p>
<p></p>
<p>The url that the popup window will navigate to. The url can be absolute, relative or root-relative.</p>
</div>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move after bottom-switch for now (switch options are grouped).


<h4>If <code>popup-url</code> attribute is provided, a popup button will be displayed. Upon clicking, it opens a new window to the specified url.</h4>
<div class="bs-example">
<panel header="Some panel" popup-url="/docs/loadContent.html">
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Root-relative url likely won't work when published on GitHub. See 7dcb507.

</div>
<doc-code language="markup">
<panel header="Some panel" popup-url="/docs/loadContent.html">
...
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For simple content, show as-is.

@@ -95,6 +95,20 @@
<doc-code language="markup">
<panel header="Dynamic Loading" src="/docs/loadContent.html#fragment" minimized></panel>
</doc-code>
<br>

<h4>If <code>popup-url</code> attribute is provided, a popup button will be displayed. Upon clicking, it opens a new window to the specified url.</h4>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about:

  • "will be shown" for consistent grammar in this docs.
  • "If clicked, it opens the specified url in a new window."

@acjh acjh merged commit 736bede into MarkBind:master May 24, 2018
@acjh acjh added this to the v1.1.37-markbind.8 milestone May 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Give a way to open a panel in a new window
4 participants