Commit b63031a6846684f809654c5bdca1a802272dc9a6
1 parent
6aaf4739
Exists in
master
and in
29 other branches
Bugfix: tinymce popup was not working
Showing
1 changed file
with
5 additions
and
21 deletions
Show diff stats
public/javascripts/catalog.js
1 | 1 | (function($) { |
2 | 2 | |
3 | -$('#product-list .product .expand-box').hover(hover, hover).live('click', function () { | |
3 | +$('#product-list .product .expand-box').live('click', function () { | |
4 | 4 | this.clicked = !this.clicked; |
5 | - click(this); | |
6 | - $.each($(this).siblings('.expand-box'), function(index, value) { value.clicked = false; click(value); }); | |
5 | + toggle_expandbox(this); | |
6 | + $.each($(this).siblings('.expand-box'), function(index, value) { value.clicked = false; toggle_expandbox(value); }); | |
7 | 7 | |
8 | 8 | return false; |
9 | 9 | }); |
10 | 10 | |
11 | 11 | $(document).live('click', function() { |
12 | - $.each($('#product-list .product .expand-box'), function(index, value) { value.clicked = false; click(value); }); | |
12 | + $.each($('#product-list .product .expand-box'), function(index, value) { value.clicked = false; toggle_expandbox(value); }); | |
13 | 13 | }); |
14 | 14 | |
15 | 15 | $(document).click(function (event) { |
... | ... | @@ -40,23 +40,7 @@ $.each(rows, function(top, obj) { |
40 | 40 | |
41 | 41 | })(jQuery); |
42 | 42 | |
43 | -function open() { | |
44 | - if (this.clicked) return; | |
45 | - jQuery(this).addClass('open'); | |
46 | -} | |
47 | - | |
48 | -function close() { | |
49 | - if (this.clicked) return; | |
50 | - jQuery(this).removeClass('open'); | |
51 | -} | |
52 | - | |
53 | -function click(e) { | |
43 | +function toggle_expandbox(e) { | |
54 | 44 | jQuery(e).toggleClass('open', e.clicked); |
55 | 45 | jQuery(e).children('div').toggle(e.clicked).css({left: jQuery(e).position().left-180, top: jQuery(e).position().top-10}); |
56 | 46 | } |
57 | - | |
58 | -function hover() { | |
59 | - jQuery(this).toggleClass('hover'); | |
60 | -} | |
61 | - | |
62 | - | ... | ... |