Skip to content
This repository has been archived by the owner on Sep 24, 2021. It is now read-only.

Commit

Permalink
Clicking an element will now toggle Strip
Browse files Browse the repository at this point in the history
This behavior can be disabled using toggle: false

Strip.show() calls don't use toggle behavior, it only works with
elements using class='strip'
  • Loading branch information
staaky committed Oct 8, 2014
1 parent 1f36dda commit 70e21cc
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "strip",
"title": "Strip",
"version": "1.0.6",
"version": "1.0.7",
"description": "A Less Intrusive Responsive Lightbox",
"author": {
"name": "Nick Stakenburg",
Expand Down
11 changes: 6 additions & 5 deletions src/css/strip/strip.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@


/* margin
we always have some margin around Strip to keep a visual reference to the underlying page
margin is added around the window to keep a visual reference
to the underlying page at all times.
*/
.strp-window { margin-left: 40px; }
.strp-window.strp-vertical { margin-left: 0; margin-bottom: 40px; }

/* reduce margin on smaller screens */
@media all and (max-width: 420px),
all and (max-height: 420px) {
@media all and (max-width: 400px),
all and (max-height: 400px) {
.strp-window { margin-left: 20px; }
.strp-window.strp-vertical { margin-bottom: 20px; }
}
Expand Down Expand Up @@ -327,8 +328,8 @@
.strp-window-skin-strip.strp-no-svg .strp-nav-hover.strp-nav-next .strp-nav-button-icon { background: url('skins/strip/next-hover.png'); }

/* Smaller screens */
@media all and (max-width: 420px),
all and (max-height: 420px) {
@media all and (max-width: 400px),
all and (max-height: 400px) {
.strp-window-skin-strip .strp-nav {
width: 40px;
height: 50px;
Expand Down
12 changes: 11 additions & 1 deletion src/js/pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,17 @@ var Pages = {
var page = this.pages[this.uid][position - 1];

// never try to reload the exact same frame
if (this.page && this.page.uid == page.uid) return;
if (this.page && this.page.uid == page.uid) {
// also hide the window if toggle is enabled
if (page.view.options.toggle) {
Window.hide();
// clear the page so double clicking when hiding will
// re-open the window even if it's in a hide animation
this.page = null;
}

return;
}

this.page = page; // store

Expand Down
1 change: 1 addition & 0 deletions src/js/skins.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Strip.Skins = {
preload: [1,2],
position: true,
side: 'right',
toggle: true,
uiDelay: 3000,
vimeo: {
autoplay: 1,
Expand Down

0 comments on commit 70e21cc

Please sign in to comment.