server-generated-popups 1.1.5 → 1.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -6
- data/app/assets/javascripts/popup.js +2 -4
- data/server-generated-popups.gemspec +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c2036800e7ea8636eb0c470c6ff5920a08488bd
|
4
|
+
data.tar.gz: 926185300b09af0d11835029cfe281073cc24b64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59d3840643ef016cad8b468eae2d98c6ee5e4441bf55ea0656ddcec9b7ed41fd2783a4121497a6e026f250d9a3f6e38d9d07599b7edf5c4c70ef35e383bb407c
|
7
|
+
data.tar.gz: bc19ce0c8419bb67508fddd2457d5cd8b0e3155fe88c12fb09ae8f959af93b409e1610c08c321c21d66e963e65bc06f11d4e40ddc1df88b9417433b1b9133810
|
data/README.md
CHANGED
@@ -61,14 +61,13 @@ Sink the popup down through the bottom of the screen:
|
|
61
61
|
popup.hide('down')
|
62
62
|
```
|
63
63
|
|
64
|
-
|
65
|
-
|
66
|
-
Say, you have buttons in your popup and want to handle clicks on them. Well, my usual advice is to go for `<%= link_to 'Button', remote: true %>` and a [JavaScript response](https://signalvnoise.com/posts/3697-server-generated-javascript-responses), but sometimes you want to do something right there on the front-end. In such case, hook up to `popup:show` event:
|
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:
|
67
65
|
|
68
66
|
```javascript
|
69
|
-
|
70
|
-
$('.
|
71
|
-
|
67
|
+
editInvoiceDetails = Popup("<%=j render @invoice %>").show('up', function () {
|
68
|
+
blink($('.heading'))
|
69
|
+
$(this).on('click', '#close.button', function () {
|
70
|
+
editInvoiceDetails.hide('down')
|
72
71
|
})
|
73
72
|
})
|
74
73
|
```
|
@@ -16,12 +16,10 @@ function Popup(html, options) {
|
|
16
16
|
this.popupWindow.animate({top: to}, callback)
|
17
17
|
}
|
18
18
|
|
19
|
-
this.show = function (direction) {
|
19
|
+
this.show = function (direction, callback) {
|
20
20
|
$('body').append(this.popupWindow)
|
21
|
-
$(document).trigger('popup:show', this)
|
22
|
-
|
23
21
|
startFrom = (direction == 'up') ? '150%' : '-50%'
|
24
|
-
move(startFrom, distanceFromTop)
|
22
|
+
move(startFrom, distanceFromTop, callback)
|
25
23
|
return this;
|
26
24
|
}
|
27
25
|
this.hide = function (direction) {
|
@@ -4,7 +4,7 @@ Gem::Specification.new do |gem|
|
|
4
4
|
gem.authors = ["Anton Khamets"]
|
5
5
|
gem.email = ["colorfulfool@gmail.com"]
|
6
6
|
gem.summary = %q{Show a popup with one line of code}
|
7
|
-
gem.summary = %q{Show a popup with one line of code. Perfect for format
|
7
|
+
gem.summary = %q{Show a popup with one line of code. Perfect for format.js responses, and just in JS too.}
|
8
8
|
gem.homepage = "https://github.com/colorfulfool/rails-popup"
|
9
9
|
|
10
10
|
gem.files = `git ls-files`.split($\)
|
@@ -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.
|
15
|
+
gem.version = "1.1.6"
|
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.
|
4
|
+
version: 1.1.6
|
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-23 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|
@@ -45,6 +45,6 @@ rubyforge_project:
|
|
45
45
|
rubygems_version: 2.5.1
|
46
46
|
signing_key:
|
47
47
|
specification_version: 4
|
48
|
-
summary:
|
49
|
-
just in JS too.
|
48
|
+
summary: Show a popup with one line of code. Perfect for format.js responses, and
|
49
|
+
just in JS too.
|
50
50
|
test_files: []
|