From ea9a0639e4c6c2e2042360426bcd98c94ccfbda8 Mon Sep 17 00:00:00 2001 From: Julian Seidenberg Date: Tue, 21 Aug 2012 17:56:40 +1200 Subject: [PATCH] BUGFIX: fixing duplicate adding of documents in the "add documents" panel --- javascript/DMSDocumentAddExistingField.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/javascript/DMSDocumentAddExistingField.js b/javascript/DMSDocumentAddExistingField.js index 5f8b421..22457b8 100644 --- a/javascript/DMSDocumentAddExistingField.js +++ b/javascript/DMSDocumentAddExistingField.js @@ -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; } });