server-generated-popups 1.4.1 → 1.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4a1533e96e1f32efa29c6c1232e63027516f6bcc
4
- data.tar.gz: 35132ea94d7e845584f44824e1d4b8791694a5c6
3
+ metadata.gz: aadd2111ad7d2d0043f03a3b99d6c281fba3b912
4
+ data.tar.gz: 7e43f3c9149588473d4037db9e28a03670e06228
5
5
  SHA512:
6
- metadata.gz: b028313ce5036431b8926b790201856281ae896f1fe6eff346734b1f28febf2c56d0a71184450823e3e1d3e2669b285af4c405b64940c1938314a00ce71f9768
7
- data.tar.gz: 6b966c8bea203a2469b287d3ce1c5ad5008662350a95a2829edc0043246066b8d3112903109de30aa1abbdf0c755d60301473087e35bd0cc88ddad96df85875a
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
- - [ ] implement animations and positioning with CSS instead of Javascript
87
- - [ ] drop jQuery dependence (use vanilla Javascript instead)
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.childNodes
9
- return (generated.length == 1 ? generated[0] : generated)
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
- setStyle(popupWindow, {top: null}) // discard the hard-coded `top`
55
-
56
- if (isNaN(finish))
57
- popupWindow.classList.add(finish)
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
@@ -12,6 +12,6 @@ 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.4.1"
15
+ gem.version = "1.4.3"
16
16
  gem.license = 'MIT'
17
17
  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.4.1
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-14 00:00:00.000000000 Z
11
+ date: 2017-08-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: