source: extensions/BatchDownloader/template/thumbnails_css_js.tpl @ 23323

Last change on this file since 23323 was 23323, checked in by mistic100, 7 years ago

move remove_image.php code to a trigger on init

File size: 1.2 KB
Line 
1{html_style}
2#thumbnails li {ldelim} position:relative !important;display:inline-block; }
3li .removeSet {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; }
4li:hover .removeSet {ldelim} display:block !important; }
5{/html_style}
6
7{footer_script require='jquery'}
8jQuery(".removeSet").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: "{$ROOT_URL}index.php",
15    data: {ldelim}
16      action: "bd_remove_image",
17      set_id: "{$SET_ID}",
18      toggle_id: toggle_id
19    },
20    success: function(msg) {ldelim}
21      if (msg == "ok") {ldelim}
22        $trigger.parent("li").hide("fast", function() {ldelim} $trigger.remove() });
23        jQuery(".nbImagesSet").html(parseInt(jQuery(".nbImagesSet").html()) -1);
24       
25        if (typeof GThumb == "object") GThumb.build();
26      } else {ldelim}
27        $trigger.html('{'Un unknown error occured'|@translate}');
28      }
29    },
30    error: function() {ldelim}
31      $trigger.html('{'Un unknown error occured'|@translate}');
32    }
33  });
34 
35  return false;
36});
37{/footer_script}
Note: See TracBrowser for help on using the repository browser.