flakey 0.8.1 → 0.8.2

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: 6df7cde2f608268b06bd0af47b20c903ac6638c3
4
- data.tar.gz: 6f1b37822dc4a4d6423242129208c2044fca2e79
3
+ metadata.gz: 456d0f35426f431eefa0505571dda563f8d33f2e
4
+ data.tar.gz: f619c10fabc526fd0a08d1dcc88a3ed4804a1ff1
5
5
  SHA512:
6
- metadata.gz: 1d3f604f7624053c37bd201936dac52d49c3f5193076658d07ac816473dfda3fa0bd3d0c42c0b74d1a6f54f0bd2de60cc04cd71688ff34297348f1df7303ffa2
7
- data.tar.gz: 8228db43a4d10f6de25515bdec6fe9c141cb303d88fa0fdcbf71f09bf8184386cd1b8ff403d87b22ccc982e46a7ae312aa0feb6aaf00e92806622a2c850b5f53
6
+ metadata.gz: a958f79454a8af4348c709fd97d3cfa24c731b796b6241adfb35c21468e49dd07d694e13212aac957c3c4c148d2ee269f1b9bae584fb2116085d6be1b2195cdb
7
+ data.tar.gz: 499fc3082dadc7108b75bafb5d98132d32aabe480e1a506c2a0a1455c3fcd2dbc919c1dfd25821230397ad3db2226b92d53b06a9df7adaa364cd54fd554ed2b8
@@ -1,3 +1,3 @@
1
1
  module Flakey
2
- VERSION = "0.8.1"
2
+ VERSION = "0.8.2"
3
3
  end
@@ -19,21 +19,35 @@ if (typeof jQuery === "undefined") {
19
19
  return window.open(url, name, opts);
20
20
  };
21
21
 
22
- $(function(){
23
- $('.custom-tweet-button, .facebook-share-button, .flakey-popup').on('click', function(e){
24
- e.preventDefault();
25
- var opts = {},
26
- $link = $(e.target).closest('a');
27
-
28
- if (typeof $link.data('flakey-width') !== "undefined") {
29
- opts.width = parseFloat($link.data('flakey-width'));
30
- };
31
-
32
- if (typeof $link.data('flakey-height') !== "undefined") {
33
- opts.height = parseFloat($link.data('flakey-height'));
34
- };
35
-
36
- var win = openPopup($link.attr('href'), 'share', opts);
37
- });
38
- });
22
+ var linkClicked = function(e) {
23
+ e.preventDefault();
24
+ var opts = {},
25
+ $link = $(e.target).closest('a');
26
+
27
+ if (typeof $link.data('flakey-width') !== "undefined") {
28
+ opts.width = parseFloat($link.data('flakey-width'));
29
+ };
30
+
31
+ if (typeof $link.data('flakey-height') !== "undefined") {
32
+ opts.height = parseFloat($link.data('flakey-height'));
33
+ };
34
+
35
+ var win = openPopup($link.attr('href'), 'share', opts);
36
+ };
37
+
38
+ var clickTargets = [
39
+ '.custom-tweet-button',
40
+ '.facebook-share-button',
41
+ '.flakey-popup'
42
+ ].join(', ');
43
+
44
+ var ready = function() {
45
+ $(clickTargets).on('click', linkClicked);
46
+ };
47
+
48
+ if (window.Turbolinks) {
49
+ $(document).on('page:change', ready);
50
+ } else {
51
+ $(ready);
52
+ }
39
53
  })(jQuery);
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flakey
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Tuite
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-25 00:00:00.000000000 Z
11
+ date: 2014-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport