Skip to content

Commit ed13a8a

Browse files
committed
Fixed hide() exception and onShow firing onresize
fixes staaky#9, fixes staaky#10
1 parent c4ac45b commit ed13a8a

7 files changed

Lines changed: 23 additions & 19 deletions

File tree

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "strip",
33
"description": "A Less Intrusive Responsive Lightbox",
4-
"version": "1.6.1",
4+
"version": "1.6.2",
55
"homepage": "http://stripjs.com",
66
"keywords": [
77
"lightbox",

dist/css/strip.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Strip - A Less Intrusive Responsive Lightbox - v1.6.1
2+
* Strip - A Less Intrusive Responsive Lightbox - v1.6.2
33
* (c) 2014-2015 Nick Stakenburg
44
*
55
* http://www.stripjs.com

dist/js/strip.pkgd.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Strip - A Less Intrusive Responsive Lightbox - v1.6.1
2+
* Strip - A Less Intrusive Responsive Lightbox - v1.6.2
33
* (c) 2014-2015 Nick Stakenburg
44
*
55
* http://www.stripjs.com
@@ -25,7 +25,7 @@
2525
}(this, function($) {
2626

2727
var Strip = {
28-
version: '1.6.1'
28+
version: '1.6.2'
2929
};
3030

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

1492+
// onShow callback
1493+
var onShow = this.view && this.view.options.onShow;
1494+
if ($.type(onShow) == 'function') {
1495+
onShow.call(Strip);
1496+
}
1497+
14921498
var duration = Window.resize(this[z], function() {
14931499
if (--fx < 1) next_shown_and_resized();
14941500
}, duration);
@@ -1955,12 +1961,6 @@ var Window = {
19551961
if (wh > 0) {
19561962
this.visible = true;
19571963
this.startObservingResize();
1958-
1959-
// onShow callback
1960-
var onShow = this.view && this.view.options.onShow;
1961-
if ($.type(onShow) == 'function') {
1962-
onShow.call(Strip);
1963-
}
19641964
}
19651965

19661966
var fromZ = Window.element['outer' + Z](),
@@ -2208,6 +2208,8 @@ var Window = {
22082208
},
22092209

22102210
hide: function(callback) {
2211+
if (!this.view) return;
2212+
22112213
var hideQueue = this.queues.hide;
22122214
hideQueue.queue([]); // clear queue
22132215

dist/js/strip.pkgd.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@staaky/strip",
33
"title": "Strip",
4-
"version": "1.6.1",
4+
"version": "1.6.2",
55
"description": "A Less Intrusive Responsive Lightbox",
66
"homepage": "http://stripjs.com",
77
"author": {

src/js/page.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,12 @@ $.extend(Page.prototype, {
364364
// store duration on resize and use it for the other animations
365365
var z = this.getOrientation() == 'horizontal' ? 'width' : 'height';
366366

367+
// onShow callback
368+
var onShow = this.view && this.view.options.onShow;
369+
if ($.type(onShow) == 'function') {
370+
onShow.call(Strip);
371+
}
372+
367373
var duration = Window.resize(this[z], function() {
368374
if (--fx < 1) next_shown_and_resized();
369375
}, duration);

src/js/window.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,6 @@ var Window = {
145145
if (wh > 0) {
146146
this.visible = true;
147147
this.startObservingResize();
148-
149-
// onShow callback
150-
var onShow = this.view && this.view.options.onShow;
151-
if ($.type(onShow) == 'function') {
152-
onShow.call(Strip);
153-
}
154148
}
155149

156150
var fromZ = Window.element['outer' + Z](),
@@ -398,6 +392,8 @@ var Window = {
398392
},
399393

400394
hide: function(callback) {
395+
if (!this.view) return;
396+
401397
var hideQueue = this.queues.hide;
402398
hideQueue.queue([]); // clear queue
403399

0 commit comments

Comments
 (0)