server-generated-popups 1.1.6 → 1.1.7

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: 7c2036800e7ea8636eb0c470c6ff5920a08488bd
4
- data.tar.gz: 926185300b09af0d11835029cfe281073cc24b64
3
+ metadata.gz: 6c4fc6bc2ea226731700a9b184b4824f074a13e7
4
+ data.tar.gz: 028cd3bd86053265d796bda23f17dd2f877b146b
5
5
  SHA512:
6
- metadata.gz: 59d3840643ef016cad8b468eae2d98c6ee5e4441bf55ea0656ddcec9b7ed41fd2783a4121497a6e026f250d9a3f6e38d9d07599b7edf5c4c70ef35e383bb407c
7
- data.tar.gz: bc19ce0c8419bb67508fddd2457d5cd8b0e3155fe88c12fb09ae8f959af93b409e1610c08c321c21d66e963e65bc06f11d4e40ddc1df88b9417433b1b9133810
6
+ metadata.gz: 7925e5191b8a7047fbd474038f3712f3f6e0547f3d6ffdf2407d20bb7afcbc31bb84ee11c517bb1327d87cdf3e4cbbfbb9175c0c7ab8a3073aba9b5986889e5c
7
+ data.tar.gz: 37b5afdfb97208c1c58090190308771675b0837a610881fa4c1395038ca8dfbad283ff6ea0d215b2c8e145ab454072153d06302717afda3554d088ca4dfae756
@@ -1,4 +1,8 @@
1
1
  function Popup(html, options) {
2
+ return new PopupClass(html, options)
3
+ }
4
+
5
+ function PopupClass(html, options) {
2
6
  contents = $(html)
3
7
  this.popupWindow = $('<div class="popup"></div>')
4
8
 
@@ -9,24 +13,23 @@ function Popup(html, options) {
9
13
  })
10
14
  this.popupWindow.append(contents)
11
15
 
12
- distanceFromTop = options.fromTop.toString() + '%'
16
+ this.distanceFromTop = options.fromTop.toString() + '%'
17
+ }
13
18
 
14
- function move(from, to, callback) {
15
- this.popupWindow.css('top', from)
16
- this.popupWindow.animate({top: to}, callback)
17
- }
19
+ PopupClass.prototype.move = function (from, to, callback) {
20
+ this.popupWindow.css('top', from)
21
+ this.popupWindow.animate({top: to}, callback)
22
+ }
18
23
 
19
- this.show = function (direction, callback) {
20
- $('body').append(this.popupWindow)
21
- startFrom = (direction == 'up') ? '150%' : '-50%'
22
- move(startFrom, distanceFromTop, callback)
23
- return this;
24
- }
25
- this.hide = function (direction) {
26
- moveTo = (direction == 'down') ? '150%' : '-50%'
27
- move(distanceFromTop, moveTo, function () {
28
- this.popupWindow.remove()
29
- })
30
- }
24
+ PopupClass.prototype.show = function (direction, callback) {
25
+ $('body').append(this.popupWindow)
26
+ startFrom = (direction == 'up') ? '150%' : '-50%'
27
+ this.move(startFrom, this.distanceFromTop, callback)
31
28
  return this;
29
+ }
30
+ PopupClass.prototype.hide = function (direction) {
31
+ moveTo = (direction == 'down') ? '150%' : '-50%'
32
+ this.move(this.distanceFromTop, moveTo, function () {
33
+ this.popupWindow.remove()
34
+ })
32
35
  }
@@ -12,5 +12,5 @@ Gem::Specification.new do |gem|
12
12
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
13
13
  gem.name = "server-generated-popups"
14
14
  gem.require_paths = ["lib"]
15
- gem.version = "1.1.6"
15
+ gem.version = "1.1.7"
16
16
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: server-generated-popups
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.6
4
+ version: 1.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Khamets