Line | |
---|
1 | {html_style} |
---|
2 | .thumbnails .wrap1 {ldelim} position:relative !important; } |
---|
3 | .addCollection {ldelim} width:100%;height:16px;display:none;position:absolute;top:0;background:rgba(0,0,0,0.8);padding:2px;border-radius:2px;font-size:0.8em;z-index:100;color:#eee;white-space:nowrap; } |
---|
4 | .wrap1:hover .addCollection {ldelim} display:block; } |
---|
5 | {/html_style} |
---|
6 | |
---|
7 | {footer_script require='jquery'} |
---|
8 | jQuery(".addCollection").click(function() {ldelim} |
---|
9 | var toggle_id = jQuery(this).data("id"); |
---|
10 | var $trigger = jQuery(this); |
---|
11 | |
---|
12 | jQuery.ajax({ldelim} |
---|
13 | type: "POST", |
---|
14 | url: "{$USER_COLLEC_PATH}toggle_image.php", |
---|
15 | data: {ldelim} {if $COL_ID}"col_id": "{$COL_ID}", {/if}"toggle_id": toggle_id } |
---|
16 | }).done(function(msg) {ldelim} |
---|
17 | if (msg == "true") {ldelim} |
---|
18 | $trigger.html('{'Remove from collection'|@translate} <img src="{$USER_COLLEC_PATH}template/image_delete.png" title="{'Remove from collection'|@translate}">'); |
---|
19 | jQuery(".nbImagesCollec").html(parseInt(jQuery(".nbImagesCollec").html()) +1); |
---|
20 | } else if (msg == "false") {ldelim} |
---|
21 | {if $COL_ID} |
---|
22 | $trigger.parent(".wrap1").hide("fast", function() {ldelim} $trigger.remove() }); |
---|
23 | {else} |
---|
24 | $trigger.html('{'Add to collection'|@translate} <img src="{$USER_COLLEC_PATH}template/image_add.png" title="{'Add to collection'|@translate}">'); |
---|
25 | {/if} |
---|
26 | jQuery(".nbImagesCollec").html(parseInt(jQuery(".nbImagesCollec").html()) -1); |
---|
27 | } else {ldelim} |
---|
28 | $trigger.html('{'Un unknown error occured'|@translate}'); |
---|
29 | } |
---|
30 | }); |
---|
31 | |
---|
32 | return false; |
---|
33 | }); |
---|
34 | {/footer_script} |
---|
Note: See
TracBrowser
for help on using the repository browser.