Advertisement
Guest User

Untitled

a guest
Apr 27th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. (function ($) {
  2. "use strict";
  3. Drupal.behaviors.origin3_user = {
  4. attach: function (context, settings) {
  5.  
  6. var user_id = settings.origin3_user_user_proof.userId;
  7. var deleteBaseUrl = settings.origin3_user_user_proof.deleteUrl;
  8.  
  9. $('#origin3-user-user-document-form input[type="file"]').each(function () {
  10. $(this).css('opacity', 0);
  11. });
  12.  
  13. $("a.add_file").on("click", function () {
  14. var field_ref = $(this).data('ref');
  15. $("#" + field_ref).trigger("click");
  16. });
  17. var url = window.location.protocol + "//" + window.location.host;
  18.  
  19. $('a.delete-link', context).once('div:not([class])', function () {
  20. var document_key = $(this).data('document-key');
  21. $(this).click(function(e) {
  22. e.preventDefault();
  23. var postAjax = $.post( url + '/user/investor/document/' + user_id + '/' + document_key + '/delete', {});
  24.  
  25. postAjax.done(function(data){
  26. $('#origin3-user-user-document-form').empty().html(data);
  27. });
  28.  
  29. });
  30. });
  31. }
  32. };
  33. })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement