Remove the afterUpdateElement callback for tags, and allow setting a
authorMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 30 Mar 2009 20:36:43 +0000 (16:36 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 30 Mar 2009 20:37:17 +0000 (16:37 -0400)
updateElement callback.

kronolith/lib/Imple/TagAutoCompleter.php

index 88173af..d35574b 100644 (file)
@@ -47,10 +47,13 @@ class Kronolith_Imple_TagAutoCompleter extends Kronolith_Imple
 
         $js_params = array(
             'tokens: [","]',
-            'indicator: "' . $this->_params['triggerId'] . '_loading_img"',
-            'afterUpdateElement: function(f, t) { if (!f.value.endsWith(";")) { f.value += ","; } f.value += " "; }'
+            'indicator: "' . $this->_params['triggerId'] . '_loading_img"'
         );
 
+        if (!empty($this->_params['updateElement'])) {
+            $js_params[] = 'updateElement: ' . $this->_params['updateElement'];
+        }
+
         $params[] = '{' . implode(',', $js_params) . '}';
 
         Kronolith::addInlineScript('new Ajax.Autocompleter(' . implode(',', $params) . ')', 'dom');