diff options
| author | Tim Almdal <tnalmdal@shaw.ca> | 2009-07-24 14:18:15 -0700 | 
|---|---|---|
| committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-07-24 14:18:15 -0700 | 
| commit | 078c77a62b623322956457bfd7bfbdaf56203b00 (patch) | |
| tree | 941a39067f101b4773a642572f24575ffc43db3e /modules/tag/helpers | |
| parent | fa1d32e6466d8c6ffe77d163e2da9c71688a3c61 (diff) | |
Add tag autocomplete to the album and photo edit pop up dialogs.
This required putting a wrapper view around the forms and passing
this view as the parameter to the item_edit_form event.  The view
contains a $script variable that the modules can add script to be
included in the form html when rendered as part of the ajax response.
Diffstat (limited to 'modules/tag/helpers')
| -rw-r--r-- | modules/tag/helpers/tag_event.php | 10 | 
1 files changed, 8 insertions, 2 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);    }  | 
