server-generated-popups 1.1.8 → 1.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -8
- data/app/assets/javascripts/popup.js +4 -4
- data/server-generated-popups.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 049e6a501a8031864eaa16b00b64b256135b5abe
|
4
|
+
data.tar.gz: 14282035b5ee7b6d3dc7872023cd3e0bcc431bd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
[
|
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:
|
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 =
|
16
|
+
this.distanceFromTop = ($(window).height() - this.popupWindow.height())/2
|
17
17
|
}
|
18
18
|
|
19
19
|
PopupClass.prototype.move = function (from, to, callback) {
|
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.
|
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-
|
11
|
+
date: 2016-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|