server-generated-popups 1.1.8 → 1.1.9

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: 56b73807e28067c336596dbdeb473e86c5c48914
4
- data.tar.gz: 93061539edc755131257f617cce53cfffc9e114e
3
+ metadata.gz: 049e6a501a8031864eaa16b00b64b256135b5abe
4
+ data.tar.gz: 14282035b5ee7b6d3dc7872023cd3e0bcc431bd7
5
5
  SHA512:
6
- metadata.gz: 0f443e807888e473e8ab5141d57951a5fff9bff7ef4db10168704ea62a8cf54832460297341c172d782d7991e4c239fb7eea1b171bffb82b909e861d4aa12ac7
7
- data.tar.gz: 53133314ec360923dc25b3d3bc376d7ac7d041ea40292d144e122a0c345b7923b17c391cdc5e9f640befbafb1026580ee5d21ca8da4bf370185a2ef31868760c
6
+ metadata.gz: 6b63fcf716b5de51c350e3424f5ffdb3d4c9919b4c92a11c1e2c67d9cdc1e5127f4e7707003bca16c5299d791b4e5e2df7d27d5d53c3900f2783f44f2a248063
7
+ data.tar.gz: 0c8c8dfbede3704d7a169fa909a11de3fde993084f968bf049d0b4a6fe0d5f7ee2c66e4641bd0d7306b8f679d6d83956e448a6398fbe1d892d76dae1e1fd7b5c
data/README.md CHANGED
@@ -30,13 +30,6 @@ Download this repo. Grab `popup.js` and `popup.css` from the `assets` directory
30
30
 
31
31
  ## Usage
32
32
 
33
- Override the size of a popup by passing these options (values in %):
34
-
35
- ```javascript
36
- Popup("<div>Hello</div>", {width: 60, fromTop: 20})
37
- ```
38
-
39
- <br />
40
33
  Raise a popup from the bottom of the screen:
41
34
 
42
35
  ```javascript
@@ -61,6 +54,13 @@ Sink the popup down through the bottom of the screen:
61
54
  popup.hide('down')
62
55
  ```
63
56
 
57
+ <br>
58
+ Override the width of a popup by passing the value in px:
59
+
60
+ ```javascript
61
+ Popup("<div>Hello</div>", {width: 300})
62
+ ```
63
+
64
64
  If you need to do something after the popup slides onto the screen — play an animation and attach a handler to the "Close" button — pass a second argument to the `show` method:
65
65
 
66
66
  ```javascript
@@ -76,4 +76,4 @@ That's all I ever need from it. Do you need something else? Feel free to contrib
76
76
 
77
77
  ## Credits
78
78
 
79
- [Anton Khamets](http://colorfulfool.github.io)
79
+ The code and the animated demo were extracted from [Invoices for Milestones](http://invoicesformilestones.com), a dead simple invoicing tool for self-employed. If you work for yourself, check it out.
@@ -6,14 +6,14 @@ function PopupClass(html, options) {
6
6
  contents = $(html)
7
7
  this.popupWindow = $('<div class="popup"></div>')
8
8
 
9
- options = $.extend({}, {width: 70, fromTop: 20}, options || {})
9
+ options = $.extend({}, {width: 300}, options || {})
10
10
  this.popupWindow.css({
11
- 'width': options.width.toString() + '%',
12
- 'margin-left': (options.width/2 * -1).toString() + '%'
11
+ 'width': options.width.toString() + 'px',
12
+ 'margin-left': (options.width/2 * -1).toString() + 'px'
13
13
  })
14
14
  this.popupWindow.append(contents)
15
15
 
16
- this.distanceFromTop = options.fromTop.toString() + '%'
16
+ this.distanceFromTop = ($(window).height() - this.popupWindow.height())/2
17
17
  }
18
18
 
19
19
  PopupClass.prototype.move = function (from, to, callback) {
@@ -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.8"
15
+ gem.version = "1.1.9"
16
16
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: server-generated-popups
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.8
4
+ version: 1.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Khamets
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-23 00:00:00.000000000 Z
11
+ date: 2016-07-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: