photoswipe-rails 4.1.0 → 4.1.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fbe868e3d71b5f5d51761e035eefaf4a3570292
|
4
|
+
data.tar.gz: fbafac179c17755ca8b30f5f4c44473463e87bf5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a189b48369ba17e4f6f04a6c2b256b4a3aac9e3c8e841ddfb565e7dcdf959add6cee375933ff4c64366549a4b7eff932f582242bdb9bbaf17c76a0d82aeb4fd
|
7
|
+
data.tar.gz: fa0aca9901eac7578769a6a572383241f5d4a1fd45aad97f66ecadc20832369014139f17b14592ad89d6789a279f641c32682116bdfe3a14e8d2587b1017f153
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! PhotoSwipe Default UI - 4.1.
|
1
|
+
/*! PhotoSwipe Default UI - 4.1.1 - 2015-12-24
|
2
2
|
* http://photoswipe.com
|
3
3
|
* Copyright (c) 2015 Dmitry Semenov; */
|
4
4
|
/**
|
@@ -93,7 +93,8 @@ var PhotoSwipeUI_Default =
|
|
93
93
|
return pswp.currItem.title || '';
|
94
94
|
},
|
95
95
|
|
96
|
-
indexIndicatorSep: ' / '
|
96
|
+
indexIndicatorSep: ' / ',
|
97
|
+
fitControlsWidth: 1200
|
97
98
|
|
98
99
|
},
|
99
100
|
_blockControlsTap,
|
@@ -117,7 +118,7 @@ var PhotoSwipeUI_Default =
|
|
117
118
|
|
118
119
|
var target = e.target || e.srcElement,
|
119
120
|
uiElement,
|
120
|
-
clickedClass = target.
|
121
|
+
clickedClass = target.getAttribute('class') || '',
|
121
122
|
found;
|
122
123
|
|
123
124
|
for(var i = 0; i < _uiElements.length; i++) {
|
@@ -149,7 +150,7 @@ var PhotoSwipeUI_Default =
|
|
149
150
|
|
150
151
|
},
|
151
152
|
_fitControlsInViewport = function() {
|
152
|
-
return !pswp.likelyTouchDevice || _options.mouseUsed || screen.width >
|
153
|
+
return !pswp.likelyTouchDevice || _options.mouseUsed || screen.width > _options.fitControlsWidth;
|
153
154
|
},
|
154
155
|
_togglePswpClass = function(el, cName, add) {
|
155
156
|
framework[ (add ? 'add' : 'remove') + 'Class' ](el, 'pswp__' + cName);
|
@@ -280,7 +281,7 @@ var PhotoSwipeUI_Default =
|
|
280
281
|
}
|
281
282
|
},
|
282
283
|
_setupFullscreenAPI = function() {
|
283
|
-
if(_options.fullscreenEl) {
|
284
|
+
if(_options.fullscreenEl && !framework.features.isOldAndroid) {
|
284
285
|
if(!_fullscrenAPI) {
|
285
286
|
_fullscrenAPI = ui.getFullscreenAPI();
|
286
287
|
}
|
@@ -574,8 +575,8 @@ var PhotoSwipeUI_Default =
|
|
574
575
|
var t = e.target || e.srcElement;
|
575
576
|
if(
|
576
577
|
t &&
|
577
|
-
t.
|
578
|
-
( t.
|
578
|
+
t.getAttribute('class') && e.type.indexOf('mouse') > -1 &&
|
579
|
+
( t.getAttribute('class').indexOf('__caption') > 0 || (/(SMALL|STRONG|EM)/i).test(t.tagName) )
|
579
580
|
) {
|
580
581
|
preventObj.prevent = false;
|
581
582
|
}
|
@@ -857,4 +858,4 @@ var PhotoSwipeUI_Default =
|
|
857
858
|
return PhotoSwipeUI_Default;
|
858
859
|
|
859
860
|
|
860
|
-
});
|
861
|
+
});
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! PhotoSwipe - v4.1.
|
1
|
+
/*! PhotoSwipe - v4.1.1 - 2015-12-24
|
2
2
|
* http://photoswipe.com
|
3
3
|
* Copyright (c) 2015 Dmitry Semenov; */
|
4
4
|
(function (root, factory) {
|
@@ -341,8 +341,7 @@ var _options = {
|
|
341
341
|
modal: true,
|
342
342
|
|
343
343
|
// not fully implemented yet
|
344
|
-
scaleMode: 'fit'
|
345
|
-
alwaysFadeIn: false // TODO
|
344
|
+
scaleMode: 'fit' // TODO
|
346
345
|
};
|
347
346
|
framework.extend(_options, options);
|
348
347
|
|
@@ -488,12 +487,11 @@ var _isOpen,
|
|
488
487
|
_moveMainScroll = function(x, dragging) {
|
489
488
|
|
490
489
|
if(!_options.loop && dragging) {
|
491
|
-
|
492
|
-
|
493
|
-
var delta = Math.round(x - _mainScrollPos.x);
|
490
|
+
var newSlideIndexOffset = _currentItemIndex + (_slideSize.x * _currPositionIndex - x) / _slideSize.x,
|
491
|
+
delta = Math.round(x - _mainScrollPos.x);
|
494
492
|
|
495
493
|
if( (newSlideIndexOffset < 0 && delta > 0) ||
|
496
|
-
(newSlideIndexOffset >= _getNumItems()-1 && delta < 0) ) {
|
494
|
+
(newSlideIndexOffset >= _getNumItems() - 1 && delta < 0) ) {
|
497
495
|
x = _mainScrollPos.x + delta * _options.mainScrollEndFriction;
|
498
496
|
}
|
499
497
|
}
|
@@ -810,7 +808,7 @@ var publicMethods = {
|
|
810
808
|
|
811
809
|
var i;
|
812
810
|
|
813
|
-
self.framework = framework; // basic
|
811
|
+
self.framework = framework; // basic functionality
|
814
812
|
self.template = template; // root DOM element of PhotoSwipe
|
815
813
|
self.bg = framework.getChildByClass(template, 'pswp__bg');
|
816
814
|
|
@@ -965,7 +963,7 @@ var publicMethods = {
|
|
965
963
|
framework.addClass(template, 'pswp--visible');
|
966
964
|
},
|
967
965
|
|
968
|
-
//
|
966
|
+
// Close the gallery, then destroy it
|
969
967
|
close: function() {
|
970
968
|
if(!_isOpen) {
|
971
969
|
return;
|
@@ -976,10 +974,10 @@ var publicMethods = {
|
|
976
974
|
_shout('close');
|
977
975
|
_unbindEvents();
|
978
976
|
|
979
|
-
_showOrHide(
|
977
|
+
_showOrHide(self.currItem, null, true, self.destroy);
|
980
978
|
},
|
981
979
|
|
982
|
-
// destroys gallery (unbinds events, cleans up intervals and timeouts to avoid memory leaks)
|
980
|
+
// destroys the gallery (unbinds events, cleans up intervals and timeouts to avoid memory leaks)
|
983
981
|
destroy: function() {
|
984
982
|
_shout('destroy');
|
985
983
|
|
@@ -996,7 +994,7 @@ var publicMethods = {
|
|
996
994
|
|
997
995
|
framework.unbind(self.scrollWrap, _downEvents, self);
|
998
996
|
|
999
|
-
// we unbind
|
997
|
+
// we unbind scroll event at the end, as closing animation may depend on it
|
1000
998
|
framework.unbind(window, 'scroll', self);
|
1001
999
|
|
1002
1000
|
_stopDragUpdateLoop();
|
@@ -1298,7 +1296,6 @@ var publicMethods = {
|
|
1298
1296
|
|
1299
1297
|
_roundPoint(destPanOffset);
|
1300
1298
|
|
1301
|
-
// _startZoomLevel = destZoomLevel;
|
1302
1299
|
var onUpdate = function(now) {
|
1303
1300
|
if(now === 1) {
|
1304
1301
|
_currZoomLevel = destZoomLevel;
|
@@ -1412,12 +1409,12 @@ var _gestureStartTime,
|
|
1412
1409
|
|
1413
1410
|
// find the closest parent DOM element
|
1414
1411
|
_closestElement = function(el, fn) {
|
1415
|
-
if(!el) {
|
1412
|
+
if(!el || el === document) {
|
1416
1413
|
return false;
|
1417
1414
|
}
|
1418
1415
|
|
1419
1416
|
// don't search elements above pswp__scroll-wrap
|
1420
|
-
if(el.
|
1417
|
+
if(el.getAttribute('class') && el.getAttribute('class').indexOf('pswp__scroll-wrap') > -1 ) {
|
1421
1418
|
return false;
|
1422
1419
|
}
|
1423
1420
|
|
@@ -2548,21 +2545,23 @@ var _showOrHideTimeout,
|
|
2548
2545
|
// if bounds aren't provided, just open gallery without animation
|
2549
2546
|
if(!duration || !thumbBounds || thumbBounds.x === undefined) {
|
2550
2547
|
|
2551
|
-
|
2552
|
-
_shout('initialZoom' + (out ? 'Out' : 'In') );
|
2548
|
+
_shout('initialZoom' + (out ? 'Out' : 'In') );
|
2553
2549
|
|
2554
|
-
|
2555
|
-
|
2556
|
-
|
2550
|
+
_currZoomLevel = item.initialZoomLevel;
|
2551
|
+
_equalizePoints(_panOffset, item.initialPosition );
|
2552
|
+
_applyCurrentZoomPan();
|
2557
2553
|
|
2558
|
-
|
2559
|
-
|
2560
|
-
_applyBgOpacity(1);
|
2554
|
+
template.style.opacity = out ? 0 : 1;
|
2555
|
+
_applyBgOpacity(1);
|
2561
2556
|
|
2557
|
+
if(duration) {
|
2558
|
+
setTimeout(function() {
|
2559
|
+
onComplete();
|
2560
|
+
}, duration);
|
2561
|
+
} else {
|
2562
2562
|
onComplete();
|
2563
|
-
}
|
2564
|
-
|
2565
|
-
|
2563
|
+
}
|
2564
|
+
|
2566
2565
|
return;
|
2567
2566
|
}
|
2568
2567
|
|
@@ -2790,7 +2789,7 @@ var _getItemAt,
|
|
2790
2789
|
// if it's not image, we return zero bounds (content is not zoomable)
|
2791
2790
|
return item.bounds;
|
2792
2791
|
}
|
2793
|
-
|
2792
|
+
|
2794
2793
|
},
|
2795
2794
|
|
2796
2795
|
|
@@ -2806,7 +2805,7 @@ var _getItemAt,
|
|
2806
2805
|
if(img) {
|
2807
2806
|
|
2808
2807
|
item.imageAppended = true;
|
2809
|
-
_setImageSize(item, img);
|
2808
|
+
_setImageSize(item, img, (item === self.currItem && _renderMaxResolution) );
|
2810
2809
|
|
2811
2810
|
baseDiv.appendChild(img);
|
2812
2811
|
|
@@ -2906,7 +2905,7 @@ _registerModule('Controller', {
|
|
2906
2905
|
index = _getLoopedId(index);
|
2907
2906
|
var item = _getItemAt(index);
|
2908
2907
|
|
2909
|
-
if(!item || item.loaded || item.loading) {
|
2908
|
+
if(!item || ((item.loaded || item.loading) && !_itemsNeedUpdate)) {
|
2910
2909
|
return;
|
2911
2910
|
}
|
2912
2911
|
|
@@ -2934,7 +2933,7 @@ _registerModule('Controller', {
|
|
2934
2933
|
_listen('beforeChange', function(diff) {
|
2935
2934
|
|
2936
2935
|
var p = _options.preload,
|
2937
|
-
isNext = diff === null ? true : (diff
|
2936
|
+
isNext = diff === null ? true : (diff >= 0),
|
2938
2937
|
preloadBefore = Math.min(p[0], _getNumItems() ),
|
2939
2938
|
preloadAfter = Math.min(p[1], _getNumItems() ),
|
2940
2939
|
i;
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: photoswipe-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kristaps Karlsons
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-02-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -82,9 +82,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
82
|
version: '0'
|
83
83
|
requirements: []
|
84
84
|
rubyforge_project:
|
85
|
-
rubygems_version: 2.4.
|
85
|
+
rubygems_version: 2.4.7
|
86
86
|
signing_key:
|
87
87
|
specification_version: 4
|
88
88
|
summary: Adds PhotoSwipe to your Rails asset pipeline
|
89
89
|
test_files: []
|
90
|
-
has_rdoc:
|