BUGFIX: fixing duplicate adding of documents in the "add documents" panel

This commit is contained in:
Julian Seidenberg 2012-08-21 17:56:40 +12:00
parent b05cb59646
commit ea9a0639e4

View File

@ -51,9 +51,10 @@
$(this).closest('.document-add-existing').selectdocument(ui.item.value, ui.item.label);
} else {
$(this).closest('.document-add-existing').adddocument(ui.item.value);
$(this).val('');
}
$(this).val('');
return false;
}
}
@ -94,16 +95,15 @@
var document_id = this.data('document-id');
var dae = this.closest('.document-add-existing');
$(this).closest('.document-add-existing').adddocument(document_id);
$(this).closest('.document-list').hide();
$(this).closest('.document-add-existing').find('input.document-autocomplete').prop('disabled', false);
if (dae.hasClass('link-editor-context')) {
dae.selectdocument(document_id, this.text());
} else {
dae.adddocument(document_id);
}
$(this).closest('.document-list').hide();
$(this).closest('.document-add-existing').find('input.document-autocomplete').prop('disabled', false);
return false;
}
});