Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Themes/default/scripts/suggest.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ smc_AutoSuggest.prototype.init = function()
// Set up all the event monitoring
this.oTextHandle.onkeydown = this.handleKey.bind(this);
this.oTextHandle.oninput = this.autoSuggestUpdate.bind(this);
this.oTextHandle.onblur = this.autoSuggestActualHide.bind(this);
// Keep suggestions visible long enough for the subsequent click event to select one.
this.oTextHandle.onblur = this.autoSuggestHide.bind(this);
this.oTextHandle.onfocus = function()
{
if (this.oSuggestDivHandle.children.length)
Expand Down Expand Up @@ -307,7 +308,8 @@ smc_AutoSuggest.prototype.addItemLink = function (sItemId, sItemName, bFromSubmi
'item_name': sItemName,
});

oNewDiv.getElementsByTagName('span')[0].addEventListener("click", this.deleteAddedItem.bind(this, oNewDiv.id));
// deleteAddedItem expects the item ID, not the already-prefixed DOM element ID.
oNewDiv.getElementsByTagName('span')[0].addEventListener("click", this.deleteAddedItem.bind(this, sItemId));
this.oItemList.appendChild(oNewDiv);

// If there's a registered callback, call it.
Expand Down