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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8be085b6ec626c5a718a3fab2b3ef10e6af77dce
4
- data.tar.gz: 2fcd3e0fc513f1ce0a6a63aee836927a031c9084
3
+ metadata.gz: ce19f5ff263d8ab687e5fd9ecdfda802a8d133a5
4
+ data.tar.gz: 2aee09927e0fd62b8fdec663871c8de364f2a802
5
5
  SHA512:
6
- metadata.gz: 317d4af9fb83747a1e543fe876d631d6d13df788c5a306a9706b245b9c528a74f9061fe1191565e848c462ac4aa5ed7f57f8ee6a4aae9f2942825eaa106112a0
7
- data.tar.gz: 7a9a051766d4bd7fb068306be6104869255159a916e95afe0ebe1c042937b9a363bd06cac739af75cfa705c694562d8d5d77a8903dcbbd5db20e426aac7da9f7
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
- Create a popup of a custom size by passing those options (values in %):
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
- $(popupWindow).css('top', from)
16
- $(popupWindow).animate({top: to}, callback)
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;
@@ -1,4 +1,4 @@
1
- module MagnificPopup
2
- class Engine < ::Rails::Engine
1
+ module ServerGeneratedPopups
2
+ class Engine < Rails::Engine
3
3
  end
4
4
  end
@@ -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.2"
15
+ gem.version = "1.1.3"
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.2
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-20 00:00:00.000000000 Z
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.4.8
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