server-generated-popups 1.1.2 → 1.1.3
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 +4 -4
- data/README.md +1 -1
- data/app/assets/javascripts/popup.js +7 -7
- data/lib/server-generated-popups.rb +2 -2
- data/server-generated-popups.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce19f5ff263d8ab687e5fd9ecdfda802a8d133a5
|
4
|
+
data.tar.gz: 2aee09927e0fd62b8fdec663871c8de364f2a802
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 337d1f6cfa8bcf97a5348f111c883b336d8b3062415ea844d30183935125f61c3ecdc4ae08823e3cfe66efdcc4b086b9cc7c1aa0f96cba5022835658f6dbc402
|
7
|
+
data.tar.gz: 3989269347f660f5d1316db3e894566c785a7b8c2e2a6bb56f35a10ebf36e0997813aec93804ce09791fb4b19eda13403ad446e275ec10e88e85835005405e11
|
data/README.md
CHANGED
@@ -30,7 +30,7 @@ Download this repo. Grab `popup.js` and `popup.css` from the `assets` directory
|
|
30
30
|
|
31
31
|
## Usage
|
32
32
|
|
33
|
-
|
33
|
+
Override the size of a popup by passing these options (values in %):
|
34
34
|
|
35
35
|
```javascript
|
36
36
|
Popup("<div>Hello</div>", {width: 60, fromTop: 20})
|
@@ -1,23 +1,23 @@
|
|
1
1
|
function Popup(html, options) {
|
2
2
|
contents = $(html)
|
3
|
-
popupWindow = $('<div class="popup"></div>')
|
3
|
+
this.popupWindow = $('<div class="popup"></div>')
|
4
4
|
|
5
5
|
options = $.extend({}, {width: 70, fromTop: 20}, options || {})
|
6
|
-
popupWindow.css({
|
6
|
+
this.popupWindow.css({
|
7
7
|
'width': options.width.toString() + '%',
|
8
8
|
'margin-left': (options.width/2 * -1).toString() + '%'
|
9
9
|
})
|
10
|
-
popupWindow.append(contents)
|
10
|
+
this.popupWindow.append(contents)
|
11
11
|
|
12
12
|
distanceFromTop = options.fromTop.toString() + '%'
|
13
13
|
|
14
14
|
function move(from, to, callback) {
|
15
|
-
|
16
|
-
|
15
|
+
this.popupWindow.css('top', from)
|
16
|
+
this.popupWindow.animate({top: to}, callback)
|
17
17
|
}
|
18
18
|
|
19
19
|
this.show = function (direction) {
|
20
|
-
$('body').append(popupWindow)
|
20
|
+
$('body').append(this.popupWindow)
|
21
21
|
startFrom = (direction == 'up') ? '150%' : '-50%'
|
22
22
|
move(startFrom, distanceFromTop)
|
23
23
|
return this;
|
@@ -25,7 +25,7 @@ function Popup(html, options) {
|
|
25
25
|
this.hide = function (direction) {
|
26
26
|
moveTo = (direction == 'down') ? '150%' : '-50%'
|
27
27
|
move(distanceFromTop, moveTo, function () {
|
28
|
-
popupWindow.remove()
|
28
|
+
this.popupWindow.remove()
|
29
29
|
})
|
30
30
|
}
|
31
31
|
return this;
|
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.3
|
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-
|
11
|
+
date: 2016-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|
@@ -42,7 +42,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
42
42
|
version: '0'
|
43
43
|
requirements: []
|
44
44
|
rubyforge_project:
|
45
|
-
rubygems_version: 2.
|
45
|
+
rubygems_version: 2.5.1
|
46
46
|
signing_key:
|
47
47
|
specification_version: 4
|
48
48
|
summary: Show a popup with one line of code. Perfect for format.js responses, and
|