Show More
@@ -6,8 +6,7 b' function addImgPreview() {' | |||||
6 | } |
|
6 | } | |
7 | }); |
|
7 | }); | |
8 |
|
8 | |||
9 |
$(' |
|
9 | $('body').on('click', '.thumb', function() { | |
10 | $(this).on('click', function() { |
|
|||
11 |
|
|
10 | var el = $(this); | |
12 |
|
|
11 | var thumb_id = 'full' + el.find('img').attr('alt'); | |
13 |
|
12 | |||
@@ -17,7 +16,6 b' function addImgPreview() {' | |||||
17 |
|
16 | |||
18 |
|
|
17 | var win_w = $(window).width(); | |
19 |
|
|
18 | var win_h = $(window).height(); | |
20 |
|
||||
21 |
|
|
19 | //new image size | |
22 |
|
|
20 | if (img_w > win_w) { | |
23 |
|
|
21 | img_h = img_h * (win_w/img_w); | |
@@ -29,7 +27,6 b' function addImgPreview() {' | |||||
29 |
|
|
27 | } | |
30 |
|
28 | |||
31 |
|
|
29 | var img_pv = new Image(); | |
32 |
|
||||
33 |
|
|
30 | $(img_pv) | |
34 |
|
|
31 | .addClass('img-full') | |
35 |
|
|
32 | .attr('id', thumb_id) | |
@@ -41,7 +38,6 b' function addImgPreview() {' | |||||
41 |
|
|
38 | 'left': (win_w - img_w) / 2, | |
42 |
|
|
39 | 'top': ((win_h - img_h) / 2) | |
43 |
|
|
40 | }) | |
44 |
|
||||
45 |
|
|
41 | //scaling preview | |
46 |
|
|
42 | .mousewheel(function(event, delta) { | |
47 |
|
|
43 | var cx = event.originalEvent.clientX, | |
@@ -53,7 +49,6 b' function addImgPreview() {' | |||||
53 |
|
49 | |||
54 |
|
|
50 | $(img_pv).width(newIW); | |
55 |
|
|
51 | $(img_pv).height(newIH); | |
56 |
|
||||
57 |
|
|
52 | //set position | |
58 |
|
|
53 | $(img_pv) | |
59 |
|
|
54 | .css({ | |
@@ -68,9 +63,7 b' function addImgPreview() {' | |||||
68 |
|
|
63 | else { | |
69 |
|
|
64 | $('#'+thumb_id).remove(); | |
70 |
|
|
65 | } | |
71 |
|
||||
72 |
|
|
66 | //prevent default | |
73 |
|
|
67 | return false; | |
74 |
|
|
68 | }); | |
75 | }); |
|
|||
76 | } No newline at end of file |
|
69 | } |
@@ -49,6 +49,9 b' function tab_handler(ev)' | |||||
49 | $('#posts').replaceWith(table_dom); |
|
49 | $('#posts').replaceWith(table_dom); | |
50 | break; |
|
50 | break; | |
51 | } |
|
51 | } | |
|
52 | ||||
|
53 | //TODO: временно | |||
|
54 | addImgPreview(); | |||
52 | } |
|
55 | } | |
53 |
|
56 | |||
54 | function make_normal_dom() |
|
57 | function make_normal_dom() | |
@@ -70,8 +73,6 b' function make_table_dom()' | |||||
70 | ); |
|
73 | ); | |
71 | } |
|
74 | } | |
72 | ); |
|
75 | ); | |
73 | //TODO: временно |
|
|||
74 | addImgPreview(); |
|
|||
75 | } |
|
76 | } | |
76 |
|
77 | |||
77 | function moveCaretToEnd(el) { |
|
78 | function moveCaretToEnd(el) { |
General Comments 0
You need to be logged in to leave comments.
Login now