server-generated-popups 1.1.9 → 1.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/popup.js +5 -4
- data/server-generated-popups.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81c141d306d989a9d4f5b84c0767257a36538e4d
|
4
|
+
data.tar.gz: f0a9cb33e5732d2fbb76bdc684447ca99cf95b2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d24a6db486a9e6d4ee8103b9b3a0efbe7bbb7db897fb15f15699678c3f1db26de29c5b97f85d2b990f2183893781ad5418ec008319a2276c4992e9cd76b3651
|
7
|
+
data.tar.gz: 4da2429b2ec4167f5bc717c69cda86a653add8642218d0c3fb66977052ae7a2a1f1dd27232c03e2dba7a612d9398d0f1bc85ed53eee8904ebab740bbee1e0f28
|
@@ -12,10 +12,11 @@ function PopupClass(html, options) {
|
|
12
12
|
'margin-left': (options.width/2 * -1).toString() + 'px'
|
13
13
|
})
|
14
14
|
this.popupWindow.append(contents)
|
15
|
+
}
|
15
16
|
|
16
|
-
|
17
|
+
PopupClass.prototype.distanceFromTop = function () {
|
18
|
+
return ($(window).height() - this.popupWindow.height())/2
|
17
19
|
}
|
18
|
-
|
19
20
|
PopupClass.prototype.move = function (from, to, callback) {
|
20
21
|
this.popupWindow.css('top', from)
|
21
22
|
this.popupWindow.animate({top: to}, callback)
|
@@ -24,12 +25,12 @@ PopupClass.prototype.move = function (from, to, callback) {
|
|
24
25
|
PopupClass.prototype.show = function (direction, callback) {
|
25
26
|
$('body').append(this.popupWindow)
|
26
27
|
startFrom = (direction == 'up') ? '180%' : '-80%'
|
27
|
-
this.move(startFrom, this.distanceFromTop, callback)
|
28
|
+
this.move(startFrom, this.distanceFromTop(), callback)
|
28
29
|
return this;
|
29
30
|
}
|
30
31
|
PopupClass.prototype.hide = function (direction) {
|
31
32
|
moveTo = (direction == 'down') ? '180%' : '-80%'
|
32
|
-
this.move(this.distanceFromTop, moveTo, function () {
|
33
|
+
this.move(this.distanceFromTop(), moveTo, function () {
|
33
34
|
this.remove() // this == $('.popup') here
|
34
35
|
})
|
35
36
|
}
|