##// END OF EJS Templates
Cleaned up popups function in JS.
neko259 -
r223:59ce9646 default
parent child Browse files
Show More
@@ -1,44 +1,44 b''
1 /**
1 /**
2 * Created with IntelliJ IDEA.
2 * Created with IntelliJ IDEA.
3 * User: vurdalak
3 * User: vurdalak
4 * Date: 21.09.13
4 * Date: 21.09.13
5 * Time: 15:21
5 * Time: 15:21
6 * To change this template use File | Settings | File Templates.
6 * To change this template use File | Settings | File Templates.
7 */
7 */
8
8
9 function addPopups() {
9 function addPopups() {
10
10
11 $('a').each(function() {
11 $('a').each(function() {
12 if($(this).text().indexOf('>>') == 0) {
12 if($(this).text().indexOf('>>') == 0) {
13 var refNum = $(this).text().match(/\d+/);
13 var refNum = $(this).text().match(/\d+/);
14
14
15 if (refNum != null) {
15 if (refNum != null) {
16 var self = $(this);
16 var self = $(this);
17
17
18 $(this).mouseenter(function(e) {
18 $(this).mouseenter(function() {
19 $.get('/get_post/' + refNum, function(data) {
19 $.get('/get_post/' + refNum, function(data) {
20 var popup = $('<div/>').html(data)
20 var popup = $('<div/>').html(data)
21 var linkPosition = self.position();
22
21
23 popup.dialog({
22 popup.dialog({
24 modal: false,
23 modal: false,
25 minHeight: 0,
24 minHeight: 0,
26 });
25 });
26
27 popup.position({
27 popup.position({
28 my: "left+20 top+20",
28 my: "left+20 top+20",
29 at: "right bottom",
29 at: "right bottom",
30 of: self
30 of: self
31 })
31 })
32
32
33 self.mouseleave(function() {
33 self.mouseleave(function() {
34 if (popup != null) {
34 if (popup != null) {
35 popup.remove();
35 popup.remove();
36 }
36 }
37 });
37 });
38 })
38 })
39 });
39 });
40 }
40 }
41 }
41 }
42 });
42 });
43
43
44 }
44 }
General Comments 0
You need to be logged in to leave comments. Login now