Skip to content

Panel: Added external panel and enhancement #370

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

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 49 additions & 19 deletions entries/panel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,36 @@
<p>To avoid blinks when opening a panel, we force hardware acceleration on WebKit browsers. The CSS that is used to do this can cause issues with buttons and form elements on the page if their container has a CSS multi-column layout (<code>column-count</code>). To resolve this you have to set the following rule for the element or its container:</p>

<pre><code><![CDATA[
-webkit-transform: translate3d(0,0,0);
-webkit-transform: translate3d( 0, 0, 0 );
Copy link
Member

Choose a reason for hiding this comment

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

This seems odd we originally used this in panel directly and removed it to fix some issues. We don't use this anywhere else including demos. cc @jaspermdegroot

Copy link
Member Author

Choose a reason for hiding this comment

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

@arschmitz should this be removed? (the paragraph to avoid blinks... and the code?) I'm ok to wait for @jaspermdegroot 's reply :-)

Copy link
Member

Choose a reason for hiding this comment

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

I would prefer to wait for @jaspermdegroot he is the one that worked on all this and knows what happened. I don't remember very well the details

Copy link
Member

Choose a reason for hiding this comment

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

This seems odd we originally used this in panel directly and removed it to fix some issues.

We still use translate3d() for panel and page wrapper transitions. This note is about a bug that appears when your page contains a CSS columns layout.

We don't use this anywhere else including demos.

Correct, we don't have demo with panels and CSS columns.

This shouldn't be removed unless the bug is fixed in all WebKit browsers/versions that we support.

Copy link
Member

Choose a reason for hiding this comment

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

@jaspermdegroot Sorry im not sure what i was doing the other day but i searched and could not find use in the repo, but i see it all over the place now. @agcolom feel free to ignore me and leave this sorry!

]]></code></pre>

<h3>External Panels</h3>
<p>Since jQuery Mobile 1.4.0, it is also possible to have external panels. This means that you can now have panels located outside the page. Panels outside of a page must be initalized manually and will not be handled by auto init. Panels outside of pages will remain in the DOM (unless manually removed) as long as you use Ajax navigation, and can be opened or closed from any page. This can be handy when you want to use the same panel on more than one page. </p>

<p>Here is an example of an external panel:</p>

<pre><code><![CDATA[
<div data-role="page">
<!-- header -->
<!-- content -->
<!-- footer -->
</div><!-- page -->

<div data-role="panel" id="mypanel">
<!-- panel content goes here -->
</div><!-- /panel -->
]]></code></pre>

<p>The panel can be enhanced manually as follows:</p>

<pre><code><![CDATA[
$( function() {
Copy link
Member Author

Choose a reason for hiding this comment

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

@arschmitz I think I should actually remove the space before function so it goes
$(function() {
Is this correct?

$( "#mypanel" ).panel();
} );
]]></code></pre>

<p>Note that if the panel contains other jQuery Mobile widgets, such as listviews, these will need to be enhanced manually as well.</p>

<h3>Panel markup conventions</h3>
<p>A panel consists of a container with a <code><![CDATA[data-role="panel"]]></code> attribute and a unique <code>ID</code>. This <code>ID</code> will be referenced by the link or button to open and close the panel. The most basic panel markup looks like this:</p>

Expand Down Expand Up @@ -194,44 +221,44 @@ $( "#idofpanel" ).panel( "close" );
<desc>Class added to the panel, page contents wrapper and fixed toolbars when option animate is true and the 3D transform feature test returns <code>true</code>.</desc>
<type name="String" />
</option>
<option name="classes.contentFixedToolbar" default='"ui-panel-fixed-toolbar-wrap"'>
<option name="classes.contentFixedToolbar" default='"ui-panel-fixed-toolbar-wrap"' removed="1.4">
<desc>
<p><strong>Note: This class is no longer used as of 1.4.0, so setting this option will have no effect on the panel.</strong></p>
<div class="warning"><strong>Note:</strong> This class is no longer used as of 1.4.0, so setting this option will have no effect on the panel.</div>
<p>Class added to the page container to suppress scrolling horizontally</p>
</desc>
<type name="String" />
</option>
<option name="classes.contentFixedToolbarClosed" default='"ui-panel-content-fixed-toolbar-closed"'>
<option name="classes.contentFixedToolbarClosed" default='"ui-panel-content-fixed-toolbar-closed"' removed="1.4">
<desc>
<p><strong>Note: This class is no longer used as of 1.4.0, so setting this option will have no effect on the panel.</strong></p>
<div class="warning"><strong>Note:</strong> This class is no longer used as of 1.4.0, so setting this option will have no effect on the panel.</div>
<p>Class added to fixed toolbars after the close animation is complete.</p>
</desc>
<type name="String" />
</option>
<option name="classes.contentFixedToolbarOpen" default='"ui-panel-content-fixed-toolbar-open"'>
<option name="classes.contentFixedToolbarOpen" default='"ui-panel-content-fixed-toolbar-open"' removed="1.4">
<desc>
<p><strong>Note: This class is no longer used as of 1.4.0, so setting this option will have no effect on the panel.</strong></p>
<div class="warning"><strong>Note:</strong> This class is no longer used as of 1.4.0, so setting this option will have no effect on the panel.</div>
<p>Class added to fixed toolbars when the panel is opening.</p>
</desc>
<type name="String" />
</option>
<option name="classes.contentWrap" default='"ui-panel-content-wrap"'>
<option name="classes.contentWrap" default='"ui-panel-content-wrap"' removed="1.4">
<desc>
<p><strong>Note: This class is no longer used as of 1.4.0, so setting this option will have no effect on the panel.</strong></p>
<div class="warning"><strong>Note:</strong> This class is no longer used as of 1.4.0, so setting this option will have no effect on the panel.</div>
<p>Class added to the wrapper injected around the page contents (header, content, footer), needed for positioning of the panel.</p>
</desc>
<type name="String" />
</option>
<option name="classes.contentWrapClosed" default='"ui-panel-content-wrap-closed"'>
<option name="classes.contentWrapClosed" default='"ui-panel-content-wrap-closed"' removed="1.4">
<desc>
<p><strong>Note: This class is no longer used as of 1.4.0, so setting this option will have no effect on the panel.</strong></p>
<div class="warning"><strong>Note:</strong> This class is no longer used as of 1.4.0, so setting this option will have no effect on the panel.</div>
<p>Class added to the page contents wrapper after the close animation is complete.</p>
</desc>
<type name="String" />
</option>
<option name="classes.contentWrapOpen" default='"ui-panel-content-wrap-open"'>
<option name="classes.contentWrapOpen" default='"ui-panel-content-wrap-open"' removed="1.4">
<desc>
<p><strong>Note: This class is no longer used as of 1.4.0, so setting this option will have no effect on the panel.</strong></p>
<div class="warning"><strong>Note:</strong> This class is no longer used as of 1.4.0, so setting this option will have no effect on the panel.</div>
<p>Class added to the wrapper injected around the page contents (header, content, footer) when the panel is opening. Used for targeting hardware acceleration only during transitions.</p>
</desc>
<type name="String" />
Expand All @@ -245,24 +272,27 @@ $( "#idofpanel" ).panel( "close" );
<type name="String" />
</option>
<option name="classes.pageContainer" default='"ui-panel-page-container"'>
<desc></desc>
<desc>Class applied to the page container.</desc>
<type name="String" />
</option>
<option name="classes.pageContentPrefix" default='"ui-panel-page-content"'>
<desc>Used for wrapper and fixed toolbars position, display and open classes.</desc>
<type name="String" />
</option>
<option name="classes.pageFixedToolbar" default='"ui-panel-fixed-toolbar"'>
<desc></desc>
<desc>Class applied to any fixed toolbars.</desc>
<type name="String" />
</option>
<option name="classes.pagePanel" default='"ui-page-panel"'>
<option name="classes.pagePanel" default='"ui-page-panel"' removed="1.4">
<desc>
<p><strong>Note: This class is no longer used as of 1.4.0, so setting this option will have no effect on the panel.</strong></p>
<div class="warning"><strong>Note:</strong> This class is no longer used as of 1.4.0, so setting this option will have no effect on the panel.</div>
<p>Class added to the page container when a panel widget is present.</p>
</desc>
<type name="String" />
</option>
<option name="classes.pagePanelOpen" default='"ui-page-panel-open"'>
<option name="classes.pagePanelOpen" default='"ui-page-panel-open"' removed="1.4">
<desc>
<p><strong>Note: This class is no longer used as of 1.4.0, so setting this option will have no effect on the panel.</strong></p>
<div class="warning"><strong>Note:</strong> This class is no longer used as of 1.4.0, so setting this option will have no effect on the panel.</div>
<p>Class added to the page when a panel is open.</p>
</desc>
<type name="String" />
Expand Down