magnific-popup-rails 0.8.8 → 0.8.9

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: 9f5c37f0a1bdc475a11a10ce7fc2a485d4fdc848
4
- data.tar.gz: c7bc9ab3cbeeff9e0f788a4625081690ac1a4524
3
+ metadata.gz: 624bb1c6f24eb32ca3081a289bd90508ba249e3d
4
+ data.tar.gz: 7c1215f4b5e94c3905b60723aed37cabb28e0a62
5
5
  SHA512:
6
- metadata.gz: c8047ae4afc82e5369ad9f868701122f7f60afa2e97a454363e7b29a1b3f09e5384472b182b3737a48acb0aa9cbb1d340e8d767afd5ae0a90fe04966580fb0c3
7
- data.tar.gz: a628027ca149648562ff1fcb66cefd4d8c3b5641b1edfd88cccf4762cc9eb02e93736d931890fa6e6ae477c1e728dc5a9d34947560f1c37cc6423839cdd0f633
6
+ metadata.gz: 7b57ccc8271ff21c04488802786695aebae9cfe72c1cd0f35ae71f6d2978d59ffffe1d9bd9f0f57bb1d90dc6e16581d188f8a2d1b5bedbc9747f2ef656f3c644
7
+ data.tar.gz: 79526db942e9a2f1070c4eed97d7acb6b74bfe168656d5b08d83e37b5e8b2b9eb022e255f2be55872840c3f8bca1dfe8c37fc695a4f9cbf33d341a715a096a09
@@ -1,5 +1,5 @@
1
1
  module MagnificPopup
2
2
  module Rails
3
- VERSION = "0.8.8"
3
+ VERSION = "0.8.9"
4
4
  end
5
5
  end
@@ -1,4 +1,4 @@
1
- /*! Magnific Popup - v0.8.8 - 2013-05-24
1
+ /*! Magnific Popup - v0.8.9 - 2013-06-04
2
2
  * http://dimsemenov.com/plugins/magnific-popup/
3
3
  * Copyright (c) 2013 Dmitry Semenov; */
4
4
  ;(function($) {
@@ -15,6 +15,7 @@
15
15
  * Private static constants
16
16
  */
17
17
  var CLOSE_EVENT = 'Close',
18
+ AFTER_CLOSE_EVENT = 'AfterClose',
18
19
  BEFORE_APPEND_EVENT = 'BeforeAppend',
19
20
  MARKUP_PARSE_EVENT = 'MarkupParse',
20
21
  OPEN_EVENT = 'Open',
@@ -141,7 +142,7 @@ MagnificPopup.prototype = {
141
142
  init: function() {
142
143
  var appVersion = navigator.appVersion;
143
144
  mfp.isIE7 = appVersion.indexOf("MSIE 7.") !== -1;
144
- mfp.isIE8 = appVersion.indexOf("MSIE 8.") !== -1,
145
+ mfp.isIE8 = appVersion.indexOf("MSIE 8.") !== -1;
145
146
  mfp.isLowIE = mfp.isIE7 || mfp.isIE8;
146
147
  mfp.isAndroid = (/android/gi).test(appVersion);
147
148
  mfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion);
@@ -227,7 +228,7 @@ MagnificPopup.prototype = {
227
228
 
228
229
  mfp.container = _getEl('container', mfp.wrap);
229
230
  }
230
-
231
+
231
232
  mfp.contentContainer = _getEl('content');
232
233
  if(mfp.st.preloader) {
233
234
  mfp.preloader = _getEl('preloader', mfp.container, mfp.st.tLoading);
@@ -308,11 +309,13 @@ MagnificPopup.prototype = {
308
309
  var bodyStyles = {};
309
310
 
310
311
  if( mfp.fixedContentPos ) {
311
- var s = mfp._getScrollbarSize();
312
- if(s) {
313
- bodyStyles.paddingRight = s;
314
- }
315
- }
312
+ if(mfp._hasScrollBar(windowHeight)){
313
+ var s = mfp._getScrollbarSize();
314
+ if(s) {
315
+ bodyStyles.paddingRight = s;
316
+ }
317
+ }
318
+ }
316
319
 
317
320
  if(mfp.fixedContentPos) {
318
321
  if(!mfp.isIE7) {
@@ -413,11 +416,11 @@ MagnificPopup.prototype = {
413
416
  mfp._removeClassFromMFP(classesToRemove);
414
417
 
415
418
  if(mfp.fixedContentPos) {
416
- var bodyStyles = {paddingRight: 0};
419
+ var bodyStyles = {paddingRight: ''};
417
420
  if(mfp.isIE7) {
418
- $('body, html').css('overflow', 'auto');
421
+ $('body, html').css('overflow', '');
419
422
  } else {
420
- bodyStyles.overflow = 'visible';
423
+ bodyStyles.overflow = '';
421
424
  }
422
425
  _body.css(bodyStyles);
423
426
  }
@@ -444,6 +447,8 @@ MagnificPopup.prototype = {
444
447
  mfp.content = null;
445
448
  mfp.currTemplate = null;
446
449
  mfp.prevHeight = 0;
450
+
451
+ _mfpTrigger(AFTER_CLOSE_EVENT);
447
452
  },
448
453
 
449
454
  updateSize: function(winHeight) {
@@ -457,6 +462,10 @@ MagnificPopup.prototype = {
457
462
  } else {
458
463
  mfp.wH = winHeight || _window.height();
459
464
  }
465
+ // Fixes #84: popup incorrectly positioned with position:relative on body
466
+ if(!mfp.fixedContentPos) {
467
+ mfp.wrap.css('height', mfp.wH);
468
+ }
460
469
 
461
470
  _mfpTrigger('Resize');
462
471
 
@@ -705,12 +714,8 @@ MagnificPopup.prototype = {
705
714
  mfp.wrap.removeClass(cName);
706
715
  },
707
716
  _hasScrollBar: function(winHeight) {
708
- if(document.body.clientHeight > (winHeight || _window.height()) ) {
709
- return true;
710
- }
711
- return false;
717
+ return ( (mfp.isIE7 ? _document.height() : document.body.scrollHeight) > (winHeight || _window.height()) )
712
718
  },
713
-
714
719
  _parseMarkup: function(template, values, item) {
715
720
  var arr;
716
721
  if(item.data) {
@@ -908,6 +913,7 @@ for(i = 0; i < rounds; i++) {
908
913
  console.log('Test #2:', performance.now() - start);
909
914
  */
910
915
 
916
+
911
917
  /*>>core*/
912
918
 
913
919
  /*>>inline*/
@@ -950,7 +956,8 @@ $.magnificPopup.registerModule(INLINE_NS, {
950
956
  if(el.length) {
951
957
 
952
958
  // If target element has parent - we replace it with placeholder and put it back after popup is closed
953
- if(el[0].parentNode !== null) {
959
+ var parent = el[0].parentNode;
960
+ if(parent && parent.tagName) {
954
961
  if(!_inlinePlaceholder) {
955
962
  _hiddenClass = inlineSt.hiddenClass;
956
963
  _inlinePlaceholder = _getEl(_hiddenClass);
@@ -1019,10 +1026,14 @@ $.magnificPopup.registerModule(AJAX_NS, {
1019
1026
  var opts = $.extend({
1020
1027
  url: item.src,
1021
1028
  success: function(data, textStatus, jqXHR) {
1029
+ var temp = {
1030
+ data:data,
1031
+ xhr:jqXHR
1032
+ };
1022
1033
 
1023
- _mfpTrigger('ParseAjax', jqXHR);
1034
+ _mfpTrigger('ParseAjax', temp);
1024
1035
 
1025
- mfp.appendContent( $(jqXHR.responseText), AJAX_NS );
1036
+ mfp.appendContent( $(temp.data), AJAX_NS );
1026
1037
 
1027
1038
  item.finished = true;
1028
1039
 
@@ -1036,6 +1047,7 @@ $.magnificPopup.registerModule(AJAX_NS, {
1036
1047
 
1037
1048
  mfp.updateStatus('ready');
1038
1049
 
1050
+ _mfpTrigger('AjaxContentAdded');
1039
1051
  },
1040
1052
  error: function() {
1041
1053
  _removeAjaxCursor();
@@ -245,7 +245,8 @@ button::-moz-focus-inner {
245
245
 
246
246
  .mfp-iframe-scaler iframe {
247
247
  position: absolute;
248
- top: -3px;
248
+ display: block;
249
+ top: 0;
249
250
  left: 0;
250
251
  width: 100%;
251
252
  height: 100%;
@@ -253,7 +254,7 @@ button::-moz-focus-inner {
253
254
  background: black; }
254
255
 
255
256
  .mfp-iframe-holder .mfp-close {
256
- top: -43px; }
257
+ top: -40px; }
257
258
 
258
259
  /* Main image in popup */
259
260
  img.mfp-img {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: magnific-popup-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.8
4
+ version: 0.8.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Jansen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-27 00:00:00.000000000 Z
11
+ date: 2013-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake