Skip to content

Commit

Permalink
Mango#5 Fix back to top.
Browse files Browse the repository at this point in the history
  • Loading branch information
pazguille committed Mar 5, 2015
1 parent a57fd79 commit 49d8a1a
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 16 deletions.
5 changes: 4 additions & 1 deletion dist/slideout.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/slideout.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion index.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ body {
z-index: 1;
}

.slideout-open,
.slideout-open body {
overflow: hidden;
}
Expand Down
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ function Slideout(options) {
// Sets panel
this.panel = options.panel;
this.menu = options.menu;
this.wrapper = options.panel.parentNode;

// Sets classnames
this.panel.className += ' slideout-panel';
Expand All @@ -77,6 +78,7 @@ Slideout.prototype.open = function() {
this._opened = true;
setTimeout(function() {
self.panel.style.transition = self.panel.style['-webkit-transition'] = '';
self.wrapper.style.overflow = 'hidden';
}, this._duration + 50);
return this;
};
Expand All @@ -93,6 +95,7 @@ Slideout.prototype.close = function() {
setTimeout(function() {
html.className = html.className.replace(/ slideout-open/, '');
self.panel.style.transition = self.panel.style['-webkit-transition'] = '';
self.wrapper.style.overflow = '';
}, this._duration + 50);
return this;
};
Expand Down
57 changes: 44 additions & 13 deletions test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,55 @@ <h3 class="menu-section-title">Docs</h3>
<li><a href="https://github.com/mango/slideout#npm-scripts" target="_blank">npm-scripts</a></li>
</ul>
</section>
</nav>

<main id="panel" class="panel">
<section class="menu-section">
<h3 class="menu-section-title">Docs</h3>
<ul class="menu-section-list">
<li><a href="https://github.com/mango/slideout#installation" target="_blank">Installation</a></li>
<li><a href="https://github.com/mango/slideout#usage" target="_blank">Usage</a></li>
<li><a href="https://github.com/mango/slideout#api" target="_blank">API</a></li>
<li><a href="https://github.com/mango/slideout#npm-scripts" target="_blank">npm-scripts</a></li>
</ul>
</section>

<header class="panel-header">
<button class="btn-hamburger js-slideout-toggle"></button>
<h1 class="title">Slideout.js</h1>
</header>
<section class="menu-section">
<h3 class="menu-section-title">Docs</h3>
<ul class="menu-section-list">
<li><a href="https://github.com/mango/slideout#installation" target="_blank">Installation</a></li>
<li><a href="https://github.com/mango/slideout#usage" target="_blank">Usage</a></li>
<li><a href="https://github.com/mango/slideout#api" target="_blank">API</a></li>
<li><a href="https://github.com/mango/slideout#npm-scripts" target="_blank">npm-scripts</a></li>
</ul>
</section>

<section class="box">
<h2 class="box-title">Test</h2>
<div id="mocha" class="box-content"></div>
<section class="menu-section">
<h3 class="menu-section-title">Docs</h3>
<ul class="menu-section-list">
<li><a href="https://github.com/mango/slideout#installation" target="_blank">Installation</a></li>
<li><a href="https://github.com/mango/slideout#usage" target="_blank">Usage</a></li>
<li><a href="https://github.com/mango/slideout#api" target="_blank">API</a></li>
<li><a href="https://github.com/mango/slideout#npm-scripts" target="_blank">npm-scripts</a></li>
</ul>
</section>
</nav>

<div class="slideout-wrapper">
<main id="panel" class="panel">
<header class="panel-header">
<button class="btn-hamburger js-slideout-toggle"></button>
<h1 class="title">Slideout.js</h1>
</header>

<section class="box">
<h2 class="box-title">Test</h2>
<div id="mocha" class="box-content"></div>
</section>

<footer class="panel-footer">
<p>with <span class="heart"></span> by <a href="https://getmango.com/en" target="_blank">Mango</a></p>
</footer>
</main>
<footer class="panel-footer">
<p>with <span class="heart"></span> by <a href="https://getmango.com/en" target="_blank">Mango</a></p>
</footer>
</main>
</div>

<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/1.13.0/mocha.min.js"></script>
<script>
Expand Down

0 comments on commit 49d8a1a

Please sign in to comment.