photoswipe-rails 4.1.0 → 4.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b5e96762270aa9d7ac2d89f20bad5fe689288ec7
4
- data.tar.gz: b89a3dfd79991ac8d0e9203a17e541afac4bbedc
3
+ metadata.gz: 3fbe868e3d71b5f5d51761e035eefaf4a3570292
4
+ data.tar.gz: fbafac179c17755ca8b30f5f4c44473463e87bf5
5
5
  SHA512:
6
- metadata.gz: 41faa363a74f39384bfed5d50e02d19f838be81d54a93546772fff8346bc4c21f01dd68fded9bf905536a785c3a9c9a3394fa4a097c1d55bb361b03a96b6664d
7
- data.tar.gz: 1afd2faec797e4c0b290193f2ac45a77725a0dc29c5cc17ccc29dbbc4716689f4f26e8d2a344aef415a010cdda0c258b2541dfb3689bc5393eee7314b3c66288
6
+ metadata.gz: 8a189b48369ba17e4f6f04a6c2b256b4a3aac9e3c8e841ddfb565e7dcdf959add6cee375933ff4c64366549a4b7eff932f582242bdb9bbaf17c76a0d82aeb4fd
7
+ data.tar.gz: fa0aca9901eac7578769a6a572383241f5d4a1fd45aad97f66ecadc20832369014139f17b14592ad89d6789a279f641c32682116bdfe3a14e8d2587b1017f153
@@ -1,4 +1,4 @@
1
- /*! PhotoSwipe Default UI - 4.1.0 - 2015-07-11
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.className,
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 > 1200;
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.className && e.type.indexOf('mouse') > -1 &&
578
- ( t.className.indexOf('__caption') > 0 || (/(SMALL|STRONG|EM)/i).test(t.tagName) )
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.0 - 2015-07-11
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', // TODO
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
- // if of current item during scroll (float)
492
- var newSlideIndexOffset = _currentItemIndex + (_slideSize.x * _currPositionIndex - x)/_slideSize.x;
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 function
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
- // Closes the gallery, then destroy it
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( self.currItem, null, true, self.destroy);
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 lost event at the end, as closing animation may depend on it
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.className && el.className.indexOf('pswp__scroll-wrap') > -1 ) {
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
- var finishWithoutAnimation = function() {
2552
- _shout('initialZoom' + (out ? 'Out' : 'In') );
2548
+ _shout('initialZoom' + (out ? 'Out' : 'In') );
2553
2549
 
2554
- _currZoomLevel = item.initialZoomLevel;
2555
- _equalizePoints(_panOffset, item.initialPosition );
2556
- _applyCurrentZoomPan();
2550
+ _currZoomLevel = item.initialZoomLevel;
2551
+ _equalizePoints(_panOffset, item.initialPosition );
2552
+ _applyCurrentZoomPan();
2557
2553
 
2558
- // no transition
2559
- template.style.opacity = out ? 0 : 1;
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
- finishWithoutAnimation();
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
- return false;
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 > 0),
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;
@@ -120,8 +120,7 @@
120
120
 
121
121
  .pswp__container,
122
122
  .pswp__zoom-wrap {
123
- -webkit-backface-visibility: hidden;
124
- will-change: transform; }
123
+ -webkit-backface-visibility: hidden; }
125
124
 
126
125
  .pswp__item {
127
126
  position: absolute;
@@ -1,3 +1,3 @@
1
1
  module PhotoSwipe
2
- VERSION = '4.1.0'
2
+ VERSION = '4.1.1'
3
3
  end
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.0
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: 2015-07-13 00:00:00.000000000 Z
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.6
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: