Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function ($) {
- "use strict";
- Drupal.behaviors.origin3_user = {
- attach: function (context, settings) {
- var user_id = settings.origin3_user_user_proof.userId;
- var deleteBaseUrl = settings.origin3_user_user_proof.deleteUrl;
- $('#origin3-user-user-document-form input[type="file"]').each(function () {
- $(this).css('opacity', 0);
- });
- $("a.add_file").on("click", function () {
- var field_ref = $(this).data('ref');
- $("#" + field_ref).trigger("click");
- });
- var url = window.location.protocol + "//" + window.location.host;
- $('a.delete-link', context).once('div:not([class])', function () {
- var document_key = $(this).data('document-key');
- $(this).click(function(e) {
- e.preventDefault();
- var postAjax = $.post( url + '/user/investor/document/' + user_id + '/' + document_key + '/delete', {});
- postAjax.done(function(data){
- $('#origin3-user-user-document-form').empty().html(data);
- });
- });
- });
- }
- };
- })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement