server-generated-popups 1.4.1 → 1.4.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 +3 -5
- data/app/assets/javascripts/popup.js +13 -11
- 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: aadd2111ad7d2d0043f03a3b99d6c281fba3b912
|
4
|
+
data.tar.gz: 7e43f3c9149588473d4037db9e28a03670e06228
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b297ad906c1a7efac1cac07a5856ad167a1793066a366603fbd5e2caeeae1ed122160da356b2dc3ba69724c0bf6e97f9073b530f0058aaf91db29f1149e7698
|
7
|
+
data.tar.gz: 81b055b0fddf9abf1110ec8afb5f40cf214b4697392290ace1c49eb78c001e0066cf67d611ecf5641f5d810cd8baac3de722a7961fb49edb670f1fd2d45c8e93
|
data/README.md
CHANGED
@@ -83,11 +83,9 @@ editInvoiceDetails = Popup("<%=j render @invoice %>").show('up', {
|
|
83
83
|
|
84
84
|
### Roadmap
|
85
85
|
|
86
|
-
- [
|
87
|
-
- [
|
86
|
+
- [x] implement animations and positioning with CSS instead of Javascript
|
87
|
+
- [x] drop jQuery dependence (use vanilla Javascript instead)
|
88
88
|
|
89
89
|
### Tools
|
90
90
|
|
91
|
-
Open demo/index.html in your browser. Make changes to the code, see the results in real time.
|
92
|
-
|
93
|
-
That's all the help I can offer for now.
|
91
|
+
Open demo/index.html in your browser. Make changes to the code, see the results in real time.
|
@@ -2,11 +2,13 @@ function Popup(html, options) {
|
|
2
2
|
return new PopupClass(html, options)
|
3
3
|
}
|
4
4
|
|
5
|
-
function createElement(html) {
|
5
|
+
function createElement(html, style) {
|
6
6
|
div = document.createElement('div')
|
7
7
|
div.innerHTML = html
|
8
|
-
generated = div.
|
9
|
-
|
8
|
+
generated = div.firstChild
|
9
|
+
if (style)
|
10
|
+
setStyle(generated, style)
|
11
|
+
return generated
|
10
12
|
}
|
11
13
|
function removeElement(element) {
|
12
14
|
element.outerHTML = ''
|
@@ -51,12 +53,13 @@ PopupClass.prototype.translate = function (start, finish, callback) {
|
|
51
53
|
popupWindow = this.popupWindow
|
52
54
|
setTimeout( // wait for CSS to notice `start` class
|
53
55
|
function () { // trigger the CSS animation
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
else
|
59
|
-
setStyle(popupWindow, {top: finish})
|
56
|
+
if (isNaN(finish)) {
|
57
|
+
setStyle(popupWindow, {top: null}) // discard hard-coded `top` to make way
|
58
|
+
popupWindow.classList.add(finish) // for this CSS class' `top`
|
59
|
+
}
|
60
|
+
else {
|
61
|
+
setStyle(popupWindow, {top: finish + 'px'})
|
62
|
+
}
|
60
63
|
setTimeout( // wait for it to finish
|
61
64
|
function () {
|
62
65
|
popupWindow.classList.remove(start)
|
@@ -73,8 +76,7 @@ PopupClass.prototype.createBackdrop = function () {
|
|
73
76
|
appendToBody(this.backdrop)
|
74
77
|
}
|
75
78
|
PopupClass.prototype.showBackdrop = function () {
|
76
|
-
setStyle(this.backdrop, {visibility: 'visible'})
|
77
|
-
setStyle(this.backdrop, {opacity: 0.5})
|
79
|
+
setStyle(this.backdrop, {visibility: 'visible', opacity: 0.5})
|
78
80
|
}
|
79
81
|
PopupClass.prototype.hideBackdrop = function () {
|
80
82
|
backdrop = this.backdrop
|
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.4.
|
4
|
+
version: 1.4.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: 2017-08-
|
11
|
+
date: 2017-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|