magnific-popup-rails 0.9.5 → 0.9.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YzIxNjFiZDllNDIzNDVhMWI4OWU3NjI2ZmQ2NjkxMzRmMTVjYjE2ZA==
4
+ NjM1YmEyMGI5Y2EyN2U4NGVjOTY5MTRlYTVmY2U3MWJjODcwOGRkMA==
5
5
  data.tar.gz: !binary |-
6
- ZjYyZGI1NjJlNmFhNDRlYzE4ZDAxN2JlMzVlYzYxYTQyYWM1ZGJiMA==
6
+ MDk4MTk3MTQ3OTk1Y2RiMmQ2ZWMyZmM0MjYyM2Q5NGFhNTQyZGI0Nw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NjRlNWU1NmM5YmYxYTk1YTNiZmJiZDA1NjFiZGM0NjU2ODAyYzg5NWY2ZTZl
10
- MTU2YjlkM2U0OTA4ZGFjMzY0ZjNjYWVkYjQxNTEyYjg4OGUyNDNiZGMyMmM1
11
- ZmQ3ZjE1YWQwN2I3YTZhYzA5OTE2NmVkN2Y1MGNlYjg4M2RhZGU=
9
+ ODBhMDFmZTY3MDYyN2Q3YzlhMmViMGUwY2QyZWVmNzU2ODMyZjQ0MmFjOWY5
10
+ ZWFiMTFmYzE0MzNhY2RiZDIyMTMwNzdmZGI4NjJjNDFlMGM2N2IyODg4N2Fk
11
+ NmNiMWY5ZjkwYWJlN2FmMDQ1ZWRiY2I1NjgxM2FkMjI5YzFhNmY=
12
12
  data.tar.gz: !binary |-
13
- N2MzZWNlMjQ5OTFkNzkzMDc3ZGNhMjFhZjM2ZWRhMTE0NDcxMzA0MDI1ZTFk
14
- NDljMmJkMmI2M2U3OTdjOWMxZmFkNGM3MGZkZTFhNDBiMTg1YjMxYTQ0YzUy
15
- NjVhNDNkMDc2NjVmOGRjMGEzOWZjNDg1NjE5MmFhMDFhZDRhOGI=
13
+ YzdiZTJjNmUzMzE1ZTBiZjFiZTc5ZTY3OGQ1OTkwYTFhYmRiNWQzOWQwOTM3
14
+ NDJlZDFmMjRkYmMxZWVhZDQ0NDZjZDBiMGYyMjMyZjA0MDI0MDA2Y2QxZjc2
15
+ MTc1OGViYmVmZDgzMzM3NmMwYTNjNmFlZGUxMzI4OGNhYmFmOTQ=
@@ -1,5 +1,5 @@
1
1
  module MagnificPopup
2
2
  module Rails
3
- VERSION = "0.9.5"
3
+ VERSION = "0.9.7"
4
4
  end
5
5
  end
@@ -1,4 +1,4 @@
1
- /*! Magnific Popup - v0.9.5 - 2013-08-21
1
+ /*! Magnific Popup - v0.9.7 - 2013-10-10
2
2
  * http://dimsemenov.com/plugins/magnific-popup/
3
3
  * Copyright (c) 2013 Dmitry Semenov; */
4
4
  ;(function($) {
@@ -414,6 +414,8 @@ MagnificPopup.prototype = {
414
414
  mfp.isOpen = true;
415
415
  mfp.updateSize(windowHeight);
416
416
  _mfpTrigger(OPEN_EVENT);
417
+
418
+ return data;
417
419
  },
418
420
 
419
421
  /**
@@ -827,8 +829,12 @@ $.magnificPopup = {
827
829
  open: function(options, index) {
828
830
  _checkInstance();
829
831
 
830
- if(!options)
832
+ if(!options) {
831
833
  options = {};
834
+ } else {
835
+ options = $.extend(true, {}, options);
836
+ }
837
+
832
838
 
833
839
  options.isObj = true;
834
840
  options.index = index || 0;
@@ -836,7 +842,7 @@ $.magnificPopup = {
836
842
  },
837
843
 
838
844
  close: function() {
839
- return $.magnificPopup.instance.close();
845
+ return $.magnificPopup.instance && $.magnificPopup.instance.close();
840
846
  },
841
847
 
842
848
  registerModule: function(name, module) {
@@ -926,7 +932,9 @@ $.fn.magnificPopup = function(options) {
926
932
  }
927
933
 
928
934
  } else {
929
-
935
+ // clone options obj
936
+ options = $.extend(true, {}, options);
937
+
930
938
  /*
931
939
  * As Zepto doesn't support .data() method for objects
932
940
  * and it works only in normal browsers
@@ -1043,6 +1051,12 @@ var AJAX_NS = 'ajax',
1043
1051
  if(_ajaxCur) {
1044
1052
  _body.removeClass(_ajaxCur);
1045
1053
  }
1054
+ },
1055
+ _destroyAjaxRequest = function() {
1056
+ _removeAjaxCursor();
1057
+ if(mfp.req) {
1058
+ mfp.req.abort();
1059
+ }
1046
1060
  };
1047
1061
 
1048
1062
  $.magnificPopup.registerModule(AJAX_NS, {
@@ -1058,14 +1072,9 @@ $.magnificPopup.registerModule(AJAX_NS, {
1058
1072
  mfp.types.push(AJAX_NS);
1059
1073
  _ajaxCur = mfp.st.ajax.cursor;
1060
1074
 
1061
- _mfpOn(CLOSE_EVENT+'.'+AJAX_NS, function() {
1062
- _removeAjaxCursor();
1063
- if(mfp.req) {
1064
- mfp.req.abort();
1065
- }
1066
- });
1075
+ _mfpOn(CLOSE_EVENT+'.'+AJAX_NS, _destroyAjaxRequest);
1076
+ _mfpOn('BeforeChange.' + AJAX_NS, _destroyAjaxRequest);
1067
1077
  },
1068
-
1069
1078
  getAjax: function(item) {
1070
1079
 
1071
1080
  if(_ajaxCur)
@@ -1384,7 +1393,8 @@ $.magnificPopup.registerModule('zoom', {
1384
1393
 
1385
1394
  initZoom: function() {
1386
1395
  var zoomSt = mfp.st.zoom,
1387
- ns = '.zoom';
1396
+ ns = '.zoom',
1397
+ image;
1388
1398
 
1389
1399
  if(!zoomSt.enabled || !mfp.supportsTransition) {
1390
1400
  return;
@@ -1488,6 +1498,7 @@ $.magnificPopup.registerModule('zoom', {
1488
1498
  if(animatedImg) {
1489
1499
  animatedImg.remove();
1490
1500
  }
1501
+ image = null;
1491
1502
  }
1492
1503
  });
1493
1504
  },
@@ -1668,7 +1679,7 @@ var _getLoopedId = function(index) {
1668
1679
  return index;
1669
1680
  },
1670
1681
  _replaceCurrTotal = function(text, curr, total) {
1671
- return text.replace('%curr%', curr + 1).replace('%total%', total);
1682
+ return text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total);
1672
1683
  };
1673
1684
 
1674
1685
  $.magnificPopup.registerModule('gallery', {
@@ -1732,8 +1743,8 @@ $.magnificPopup.registerModule('gallery', {
1732
1743
  _mfpOn('BuildControls' + ns, function() {
1733
1744
  if(mfp.items.length > 1 && gSt.arrows && !mfp.arrowLeft) {
1734
1745
  var markup = gSt.arrowMarkup,
1735
- arrowLeft = mfp.arrowLeft = $( markup.replace('%title%', gSt.tPrev).replace('%dir%', 'left') ).addClass(PREVENT_CLOSE_CLASS),
1736
- arrowRight = mfp.arrowRight = $( markup.replace('%title%', gSt.tNext).replace('%dir%', 'right') ).addClass(PREVENT_CLOSE_CLASS);
1746
+ arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS),
1747
+ arrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS);
1737
1748
 
1738
1749
  var eName = supportsFastClick ? 'mfpFastClick' : 'click';
1739
1750
  arrowLeft[eName](function() {
@@ -50,16 +50,14 @@
50
50
  text-align: left;
51
51
  z-index: 1045; }
52
52
 
53
- .mfp-inline-holder .mfp-content,
54
- .mfp-ajax-holder .mfp-content {
53
+ .mfp-inline-holder .mfp-content, .mfp-ajax-holder .mfp-content {
55
54
  width: 100%;
56
55
  cursor: auto; }
57
56
 
58
57
  .mfp-ajax-cur {
59
58
  cursor: progress; }
60
59
 
61
- .mfp-zoom-out-cur,
62
- .mfp-zoom-out-cur .mfp-image-holder .mfp-close {
60
+ .mfp-zoom-out-cur, .mfp-zoom-out-cur .mfp-image-holder .mfp-close {
63
61
  cursor: -moz-zoom-out;
64
62
  cursor: -webkit-zoom-out;
65
63
  cursor: zoom-out; }
@@ -73,10 +71,7 @@
73
71
  .mfp-auto-cursor .mfp-content {
74
72
  cursor: auto; }
75
73
 
76
- .mfp-close,
77
- .mfp-arrow,
78
- .mfp-preloader,
79
- .mfp-counter {
74
+ .mfp-close, .mfp-arrow, .mfp-preloader, .mfp-counter {
80
75
  -webkit-user-select: none;
81
76
  -moz-user-select: none;
82
77
  user-select: none; }
@@ -97,12 +92,10 @@
97
92
  left: 8px;
98
93
  right: 8px;
99
94
  z-index: 1044; }
100
-
101
- .mfp-preloader a {
102
- color: #cccccc; }
103
-
104
- .mfp-preloader a:hover {
105
- color: white; }
95
+ .mfp-preloader a {
96
+ color: #cccccc; }
97
+ .mfp-preloader a:hover {
98
+ color: white; }
106
99
 
107
100
  .mfp-s-ready .mfp-preloader {
108
101
  display: none; }
@@ -110,19 +103,18 @@
110
103
  .mfp-s-error .mfp-content {
111
104
  display: none; }
112
105
 
113
- button.mfp-close,
114
- button.mfp-arrow {
106
+ button.mfp-close, button.mfp-arrow {
115
107
  overflow: visible;
116
108
  cursor: pointer;
117
109
  background: transparent;
118
110
  border: 0;
119
111
  -webkit-appearance: none;
120
112
  display: block;
113
+ outline: none;
121
114
  padding: 0;
122
115
  z-index: 1046;
123
116
  -webkit-box-shadow: none;
124
117
  box-shadow: none; }
125
-
126
118
  button::-moz-focus-inner {
127
119
  padding: 0;
128
120
  border: 0; }
@@ -150,8 +142,7 @@ button::-moz-focus-inner {
150
142
  .mfp-close-btn-in .mfp-close {
151
143
  color: #333333; }
152
144
 
153
- .mfp-image-holder .mfp-close,
154
- .mfp-iframe-holder .mfp-close {
145
+ .mfp-image-holder .mfp-close, .mfp-iframe-holder .mfp-close {
155
146
  color: white;
156
147
  right: -6px;
157
148
  text-align: right;
@@ -176,85 +167,70 @@ button::-moz-focus-inner {
176
167
  width: 90px;
177
168
  height: 110px;
178
169
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0); }
179
-
180
- .mfp-arrow:active {
181
- margin-top: -54px; }
182
-
183
- .mfp-arrow:hover,
184
- .mfp-arrow:focus {
185
- opacity: 1; }
186
-
187
- .mfp-arrow:before, .mfp-arrow:after,
188
- .mfp-arrow .mfp-b,
189
- .mfp-arrow .mfp-a {
190
- content: '';
191
- display: block;
192
- width: 0;
193
- height: 0;
194
- position: absolute;
195
- left: 0;
196
- top: 0;
197
- margin-top: 35px;
198
- margin-left: 35px;
199
- border: medium inset transparent; }
200
- .mfp-arrow:after,
201
- .mfp-arrow .mfp-a {
202
- border-top-width: 13px;
203
- border-bottom-width: 13px;
204
- top: 8px; }
205
- .mfp-arrow:before,
206
- .mfp-arrow .mfp-b {
207
- border-top-width: 21px;
208
- border-bottom-width: 21px; }
170
+ .mfp-arrow:active {
171
+ margin-top: -54px; }
172
+ .mfp-arrow:hover, .mfp-arrow:focus {
173
+ opacity: 1; }
174
+ .mfp-arrow:before, .mfp-arrow:after, .mfp-arrow .mfp-b, .mfp-arrow .mfp-a {
175
+ content: '';
176
+ display: block;
177
+ width: 0;
178
+ height: 0;
179
+ position: absolute;
180
+ left: 0;
181
+ top: 0;
182
+ margin-top: 35px;
183
+ margin-left: 35px;
184
+ border: medium inset transparent; }
185
+ .mfp-arrow:after, .mfp-arrow .mfp-a {
186
+ border-top-width: 13px;
187
+ border-bottom-width: 13px;
188
+ top: 8px; }
189
+ .mfp-arrow:before, .mfp-arrow .mfp-b {
190
+ border-top-width: 21px;
191
+ border-bottom-width: 21px; }
209
192
 
210
193
  .mfp-arrow-left {
211
194
  left: 0; }
212
- .mfp-arrow-left:after,
213
- .mfp-arrow-left .mfp-a {
195
+ .mfp-arrow-left:after, .mfp-arrow-left .mfp-a {
214
196
  border-right: 17px solid white;
215
197
  margin-left: 31px; }
216
- .mfp-arrow-left:before,
217
- .mfp-arrow-left .mfp-b {
198
+ .mfp-arrow-left:before, .mfp-arrow-left .mfp-b {
218
199
  margin-left: 25px;
219
200
  border-right: 27px solid #3f3f3f; }
220
201
 
221
202
  .mfp-arrow-right {
222
203
  right: 0; }
223
- .mfp-arrow-right:after,
224
- .mfp-arrow-right .mfp-a {
204
+ .mfp-arrow-right:after, .mfp-arrow-right .mfp-a {
225
205
  border-left: 17px solid white;
226
206
  margin-left: 39px; }
227
- .mfp-arrow-right:before,
228
- .mfp-arrow-right .mfp-b {
207
+ .mfp-arrow-right:before, .mfp-arrow-right .mfp-b {
229
208
  border-left: 27px solid #3f3f3f; }
230
209
 
231
210
  .mfp-iframe-holder {
232
211
  padding-top: 40px;
233
212
  padding-bottom: 40px; }
234
-
235
- .mfp-iframe-holder .mfp-content {
236
- line-height: 0;
237
- width: 100%;
238
- max-width: 900px; }
213
+ .mfp-iframe-holder .mfp-content {
214
+ line-height: 0;
215
+ width: 100%;
216
+ max-width: 900px; }
217
+ .mfp-iframe-holder .mfp-close {
218
+ top: -40px; }
239
219
 
240
220
  .mfp-iframe-scaler {
241
221
  width: 100%;
242
222
  height: 0;
243
223
  overflow: hidden;
244
224
  padding-top: 56.25%; }
245
-
246
- .mfp-iframe-scaler iframe {
247
- position: absolute;
248
- display: block;
249
- top: 0;
250
- left: 0;
251
- width: 100%;
252
- height: 100%;
253
- box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
254
- background: black; }
255
-
256
- .mfp-iframe-holder .mfp-close {
257
- top: -40px; }
225
+ .mfp-iframe-scaler iframe {
226
+ position: absolute;
227
+ display: block;
228
+ top: 0;
229
+ left: 0;
230
+ width: 100%;
231
+ height: 100%;
232
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
233
+ background: black; }
258
234
 
259
235
  /* Main image in popup */
260
236
  img.mfp-img {
@@ -270,22 +246,26 @@ img.mfp-img {
270
246
  margin: 0 auto; }
271
247
 
272
248
  /* The shadow behind the image */
273
- .mfp-figure:after {
274
- content: '';
275
- position: absolute;
276
- left: 0;
277
- top: 40px;
278
- bottom: 40px;
279
- display: block;
280
- right: 0;
281
- width: auto;
282
- height: auto;
283
- z-index: -1;
284
- box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
285
- background: #444444; }
286
-
287
249
  .mfp-figure {
288
250
  line-height: 0; }
251
+ .mfp-figure:after {
252
+ content: '';
253
+ position: absolute;
254
+ left: 0;
255
+ top: 40px;
256
+ bottom: 40px;
257
+ display: block;
258
+ right: 0;
259
+ width: auto;
260
+ height: auto;
261
+ z-index: -1;
262
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
263
+ background: #444444; }
264
+ .mfp-figure small {
265
+ color: #bdbdbd;
266
+ display: block;
267
+ font-size: 12px;
268
+ line-height: 14px; }
289
269
 
290
270
  .mfp-bottom-bar {
291
271
  margin-top: -36px;
@@ -302,12 +282,6 @@ img.mfp-img {
302
282
  word-wrap: break-word;
303
283
  padding-right: 36px; }
304
284
 
305
- .mfp-figure small {
306
- color: #bdbdbd;
307
- display: block;
308
- font-size: 12px;
309
- line-height: 14px; }
310
-
311
285
  .mfp-image-holder .mfp-content {
312
286
  max-width: 100%; }
313
287
 
@@ -316,20 +290,21 @@ img.mfp-img {
316
290
 
317
291
  @media screen and (max-width: 800px) and (orientation: landscape), screen and (max-height: 300px) {
318
292
  /**
319
- * Remove all paddings around the image on small screen
320
- */
293
+ * Remove all paddings around the image on small screen
294
+ */
321
295
  .mfp-img-mobile .mfp-image-holder {
322
296
  padding-left: 0;
323
297
  padding-right: 0; }
324
-
325
298
  .mfp-img-mobile img.mfp-img {
326
299
  padding: 0; }
327
-
328
- /* The shadow behind the image */
329
- .mfp-img-mobile .mfp-figure:after {
330
- top: 0;
331
- bottom: 0; }
332
-
300
+ .mfp-img-mobile .mfp-figure {
301
+ /* The shadow behind the image */ }
302
+ .mfp-img-mobile .mfp-figure:after {
303
+ top: 0;
304
+ bottom: 0; }
305
+ .mfp-img-mobile .mfp-figure small {
306
+ display: inline;
307
+ margin-left: 5px; }
333
308
  .mfp-img-mobile .mfp-bottom-bar {
334
309
  background: rgba(0, 0, 0, 0.6);
335
310
  bottom: 0;
@@ -340,14 +315,11 @@ img.mfp-img {
340
315
  -webkit-box-sizing: border-box;
341
316
  -moz-box-sizing: border-box;
342
317
  box-sizing: border-box; }
343
-
344
- .mfp-img-mobile .mfp-bottom-bar:empty {
345
- padding: 0; }
346
-
318
+ .mfp-img-mobile .mfp-bottom-bar:empty {
319
+ padding: 0; }
347
320
  .mfp-img-mobile .mfp-counter {
348
321
  right: 5px;
349
322
  top: 3px; }
350
-
351
323
  .mfp-img-mobile .mfp-close {
352
324
  top: 0;
353
325
  right: 0;
@@ -357,27 +329,22 @@ img.mfp-img {
357
329
  background: rgba(0, 0, 0, 0.6);
358
330
  position: fixed;
359
331
  text-align: center;
360
- padding: 0; }
332
+ padding: 0; } }
361
333
 
362
- .mfp-img-mobile .mfp-figure small {
363
- display: inline;
364
- margin-left: 5px; } }
365
334
  @media all and (max-width: 900px) {
366
335
  .mfp-arrow {
367
336
  -webkit-transform: scale(0.75);
368
337
  transform: scale(0.75); }
369
-
370
338
  .mfp-arrow-left {
371
339
  -webkit-transform-origin: 0;
372
340
  transform-origin: 0; }
373
-
374
341
  .mfp-arrow-right {
375
342
  -webkit-transform-origin: 100%;
376
343
  transform-origin: 100%; }
377
-
378
344
  .mfp-container {
379
345
  padding-left: 6px;
380
346
  padding-right: 6px; } }
347
+
381
348
  .mfp-ie7 .mfp-img {
382
349
  padding: 0; }
383
350
  .mfp-ie7 .mfp-bottom-bar {
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.9.5
4
+ version: 0.9.7
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-08-21 00:00:00.000000000 Z
11
+ date: 2013-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake