source: extensions/UserCollections/template/thumbnails_css_js.tpl @ 20097

Last change on this file since 20097 was 20097, checked in by mistic100, 11 years ago

full compatibility with Gthumb+, improve some code

File size: 1.5 KB
Line 
1{html_style}
2.thumbnails .wrap1 {ldelim} position:relative !important; }
3.wrap1 .addCollection, .gthumb .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:10px;z-index:100 !important;color:#eee;white-space:nowrap; }
4.wrap1:hover .addCollection, .gthumb:hover .addCollection {ldelim} display:block; }
5{/html_style}
6
7{if not $NO_AJAX}
8{footer_script require='jquery'}
9jQuery(".addCollection").click(function() {ldelim}
10  var toggle_id = jQuery(this).data("id");
11  var $trigger = jQuery(this);
12 
13  jQuery.ajax({ldelim}
14    type: "POST",
15    url: "{$ROOT_URL}{$USER_COLLEC_PATH}toggle_image.php",
16    data: {ldelim} {if $COL_ID}"col_id": "{$COL_ID}", {/if}"toggle_id": toggle_id }
17  }).done(function(msg) {ldelim}
18    if (msg == "true") {ldelim}
19      $trigger.children(".uc_remove").show();
20      $trigger.children(".uc_add").hide();
21      jQuery(".nbImagesCollec").html(parseInt(jQuery(".nbImagesCollec").html()) +1);
22    } else if (msg == "false") {ldelim}
23    {if $COL_ID}
24      $trigger.parent(".wrap1, .gthumb").hide("fast", function() {ldelim} $trigger.remove() });
25      if (typeof batchdown_count != 'undefined') batchdown_count-=1;
26    {else}
27      $trigger.children(".uc_remove").hide();
28      $trigger.children(".uc_add").show();
29    {/if}
30    jQuery(".nbImagesCollec").html(parseInt(jQuery(".nbImagesCollec").html()) -1);
31    } else {ldelim}
32      $trigger.html('{'Un unknown error occured'|@translate}');
33    }
34  });
35 
36  return false;
37});
38{/footer_script}
39{/if}
Note: See TracBrowser for help on using the repository browser.