hooch 0.15.22 → 0.15.23

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: 584beed1dc2f45bd0862a5d09c496f3e3642943d
4
- data.tar.gz: fda6ef758f27d76e3daf3658e8c206d7f54f7e47
3
+ metadata.gz: c6788c9c60a2caf174c51ec87262413fb1e895e3
4
+ data.tar.gz: 4420eeaf68065fe3a3e1cbd0e7822aa6dd9fa7a5
5
5
  SHA512:
6
- metadata.gz: e585b419dd96204b169656a5667972eaa2c0bd07440f7cf09b1edd7b3e26f8332ebb5a96ae3590f4271846bdd36c97e74b652f3205c9c03803fe60622ff0bf4c
7
- data.tar.gz: 8efd12a6aa93bdac04c49d8c127009522b5f68ae36498584c3219ea3ffe3c5a1e08e96d93192a97af3187e508fa4239b7af7669c70bd5d930835a90880667721
6
+ metadata.gz: 496455d7ab46420cf47a35670e127c13db153ba128e1ac2e9b57b0d8fa8c7fb46f88e9ce0d7a65118208d9cfde07b7fb288c274a3df9f67f12c6c863606234b9
7
+ data.tar.gz: 636c2d5ea8e80ae24206385d6f3ba2bf4d64b822cbd719117822a8b1c4d2073a94a2ebc01283205291734750359f047fe900ef5c65c13a623561feb2eb563619
@@ -850,8 +850,30 @@ var initHooch = function(){
850
850
  }),
851
851
  Link: Class.extend({
852
852
  init: function($link){
853
- $link.click(function(){
854
- window.location = $link.attr('href');
853
+ this.$link = $link;
854
+ this.getTarget()
855
+ this.bindLink()
856
+ },
857
+ getTarget: function($link){
858
+ this.target = this.$link.data('link-target')
859
+ },
860
+ bindLink: function(){
861
+ if(this.target){
862
+ this.bindWithTarget()
863
+ } else {
864
+ this.bindWithoutTarget()
865
+ }
866
+ },
867
+ bindWithTarget: function(){
868
+ var link = this
869
+ this.$link.on('click', function(){
870
+ window.open(link.$link.attr('href'), this.$target)
871
+ })
872
+ },
873
+ bindWithoutTarget: function(){
874
+ var link = this
875
+ this.$link.on('click', function(){
876
+ window.location = link.$link.attr('href');
855
877
  })
856
878
  }
857
879
  }),
@@ -1,3 +1,3 @@
1
1
  module Hooch
2
- VERSION = "0.15.22"
2
+ VERSION = "0.15.23"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hooch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.22
4
+ version: 0.15.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Draut
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-14 00:00:00.000000000 Z
11
+ date: 2018-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails