summaryrefslogtreecommitdiff
path: root/modules/tag
diff options
context:
space:
mode:
Diffstat (limited to 'modules/tag')
-rw-r--r--modules/tag/helpers/tag_event.php10
-rw-r--r--modules/tag/js/tag.js2
2 files changed, 9 insertions, 3 deletions
diff --git a/modules/tag/helpers/tag_event.php b/modules/tag/helpers/tag_event.php
index e1ab1b73..58034900 100644
--- a/modules/tag/helpers/tag_event.php
+++ b/modules/tag/helpers/tag_event.php
@@ -64,9 +64,15 @@ class tag_event_Core {
tag::compact();
}
- static function item_edit_form($item, $form) {
+ static function item_edit_form($item, $view) {
+ $url = url::site("tags/autocomplete");
+ $view->script[] = "$('#gEditFormContainer form').ready(function() {
+ $('#gEditFormContainer form input[id=tags]').autocomplete(
+ '$url', {max: 30, formatResult: formatTagAutoCompleteResult}
+ );
+ });";
$tag_value = implode("; ", tag::item_tags($item));
- $form->edit_item->input("tags")->label(t("Tags (separate by , or ;)"))
+ $view->form->edit_item->input("tags")->label(t("Tags (separate by , or ;)"))
->value($tag_value);
}
diff --git a/modules/tag/js/tag.js b/modules/tag/js/tag.js
index 282da1ea..bbf44166 100644
--- a/modules/tag/js/tag.js
+++ b/modules/tag/js/tag.js
@@ -68,7 +68,7 @@ function editInPlace(element) {
}
function formatTagAutoCompleteResult(row) {
- var text = $("#gAddTagForm input:text").val();
+ var text = $(".ac_loading").val();
if (/[\s,;]/.test(text)) {
for (var i= text.length - 1; i >= 0; i--) {
var chr = text.charAt(i);