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

Commit

Permalink
Fixed hide() exception and onShow firing onresize
Browse files Browse the repository at this point in the history
fixes #9, fixes #10
  • Loading branch information
staaky committed Oct 5, 2015
1 parent c4ac45b commit ed13a8a
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 19 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "strip",
"description": "A Less Intrusive Responsive Lightbox",
"version": "1.6.1",
"version": "1.6.2",
"homepage": "http://stripjs.com",
"keywords": [
"lightbox",
Expand Down
2 changes: 1 addition & 1 deletion dist/css/strip.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Strip - A Less Intrusive Responsive Lightbox - v1.6.1
* Strip - A Less Intrusive Responsive Lightbox - v1.6.2
* (c) 2014-2015 Nick Stakenburg
*
* http://www.stripjs.com
Expand Down
18 changes: 10 additions & 8 deletions dist/js/strip.pkgd.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Strip - A Less Intrusive Responsive Lightbox - v1.6.1
* Strip - A Less Intrusive Responsive Lightbox - v1.6.2
* (c) 2014-2015 Nick Stakenburg
*
* http://www.stripjs.com
Expand All @@ -25,7 +25,7 @@
}(this, function($) {

var Strip = {
version: '1.6.1'
version: '1.6.2'
};

Strip.Skins = {
Expand Down Expand Up @@ -1489,6 +1489,12 @@ $.extend(Page.prototype, {
// store duration on resize and use it for the other animations
var z = this.getOrientation() == 'horizontal' ? 'width' : 'height';

// onShow callback
var onShow = this.view && this.view.options.onShow;
if ($.type(onShow) == 'function') {
onShow.call(Strip);
}

var duration = Window.resize(this[z], function() {
if (--fx < 1) next_shown_and_resized();
}, duration);
Expand Down Expand Up @@ -1955,12 +1961,6 @@ var Window = {
if (wh > 0) {
this.visible = true;
this.startObservingResize();

// onShow callback
var onShow = this.view && this.view.options.onShow;
if ($.type(onShow) == 'function') {
onShow.call(Strip);
}
}

var fromZ = Window.element['outer' + Z](),
Expand Down Expand Up @@ -2208,6 +2208,8 @@ var Window = {
},

hide: function(callback) {
if (!this.view) return;

var hideQueue = this.queues.hide;
hideQueue.queue([]); // clear queue

Expand Down
4 changes: 2 additions & 2 deletions dist/js/strip.pkgd.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@staaky/strip",
"title": "Strip",
"version": "1.6.1",
"version": "1.6.2",
"description": "A Less Intrusive Responsive Lightbox",
"homepage": "http://stripjs.com",
"author": {
Expand Down
6 changes: 6 additions & 0 deletions src/js/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,12 @@ $.extend(Page.prototype, {
// store duration on resize and use it for the other animations
var z = this.getOrientation() == 'horizontal' ? 'width' : 'height';

// onShow callback
var onShow = this.view && this.view.options.onShow;
if ($.type(onShow) == 'function') {
onShow.call(Strip);
}

var duration = Window.resize(this[z], function() {
if (--fx < 1) next_shown_and_resized();
}, duration);
Expand Down
8 changes: 2 additions & 6 deletions src/js/window.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,6 @@ var Window = {
if (wh > 0) {
this.visible = true;
this.startObservingResize();

// onShow callback
var onShow = this.view && this.view.options.onShow;
if ($.type(onShow) == 'function') {
onShow.call(Strip);
}
}

var fromZ = Window.element['outer' + Z](),
Expand Down Expand Up @@ -398,6 +392,8 @@ var Window = {
},

hide: function(callback) {
if (!this.view) return;

var hideQueue = this.queues.hide;
hideQueue.queue([]); // clear queue

Expand Down

0 comments on commit ed13a8a

Please sign in to comment.