From 58eea6d0cad8411689f84c8d8916622680376bb5 Mon Sep 17 00:00:00 2001 From: Victor Dubiniuk Date: Fri, 16 Aug 2013 17:51:08 +0300 Subject: [PATCH] Autocomplete improvement --- css/style.css | 5 +++++ js/office.js | 12 +++++++++--- templates/documents.php | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/css/style.css b/css/style.css index 98df338a..9386993e 100755 --- a/css/style.css +++ b/css/style.css @@ -55,4 +55,9 @@ float:left; right:72px; padding: 10px; background-color: #ddd; +} + +#invitee-list li{ + padding: 5px 0 5px 20px; + background: url('%webroot%/core/img/actions/delete.svg') 0 50% no-repeat; } \ No newline at end of file diff --git a/js/office.js b/js/office.js index 3a627003..49fcd0ee 100644 --- a/js/office.js +++ b/js/office.js @@ -149,6 +149,9 @@ $(document).ready(function() { $('#odf_close').live('click', officeMain.onClose); $('#odf_invite').live('click', officeMain.onInvite); $('#invite-send').live('click', officeMain.sendInvite); + $('#invitee-list li').live('click', function(){ + $(this).remove(); + }); $('#inivite-input').autocomplete({ minLength: 1, @@ -163,15 +166,18 @@ $(document).ready(function() { }); }, select: function(event, el) { - var item = $( - '
  • ' + event.preventDefault(); + var item = $( + '
  • ' + el.item.label + '' + '
  • ' ); - $('#invitee-list').append(item); + $('#invitee-list').prepend(item); } }); diff --git a/templates/documents.php b/templates/documents.php index 15581ab4..bf2feb46 100755 --- a/templates/documents.php +++ b/templates/documents.php @@ -1,7 +1,7 @@