Fix ajax-loading of changelog.
authorJan Schneider <jan@horde.org>
Tue, 24 Aug 2010 15:55:36 +0000 (17:55 +0200)
committerJan Schneider <jan@horde.org>
Tue, 24 Aug 2010 15:55:36 +0000 (17:55 +0200)
chora/annotate.php
chora/js/annotate.js

index cb769cc..19aff86 100644 (file)
@@ -50,7 +50,7 @@ $extraLink = sprintf('<a href="%s">%s</a> | <a href="%s">%s</a>',
 Horde::addScriptFile('annotate.js', 'chora');
 
 $js_vars = array(
-    'ANNOTATE_URL' => (string)Horde_Util::addParameter(Horde::applicationUrl('annotate.php'), array('actionID' => 'log', 'f' => $where, 'rev' => ''), null, false),
+    'ANNOTATE_URL' => (string)Horde::applicationUrl('annotate.php', true)->add(array('actionID' => 'log', 'f' => $where, 'rev' => '')),
     'loading_text' => _("Loading...")
 );
 
index 479d7f5..e4bd30c 100644 (file)
@@ -1,29 +1,22 @@
 /**
  * Chora annotate.php javascript code.
  *
- * @author Michael Slusarz <slusarz@horde.org>
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
  *
- * See the enclosed file COPYING for license information (LGPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
+ * @author Michael Slusarz <slusarz@horde.org>
  */
 
 var Chora_Annotate = {
     showLog: function(e) {
-        var elt = e.element(), rev, newelt;
-        if (!elt.hasClassName('logdisplay')) {
-            elt = elt.up('SPAN.logdisplay');
-            if (!elt) {
-                return;
-            }
+        var elt = e.findElement('span.logdisplay'), rev, newelt;
+        if (!elt) {
+            return;
         }
-
         e.stop();
-
-        rev = elt.hide().up('TD').down('A').readAttribute('rev');
-        newelt = new Element('TD', { colspan: 5 }).insert(Chora.loading_text);
-
-        elt.up('TR').insert({ after: new Element('TR', { className: 'logentry' }).insert(newelt) });
-
+        rev = elt.hide().up('td').down('a').readAttribute('rev');
+        newelt = new Element('td', { colspan: 5 }).insert(Chora.loading_text);
+        elt.up('tr').insert({ after: new Element('tr', { className: 'logentry' }).insert(newelt) });
         new Ajax.Updater(newelt, Chora.ANNOTATE_URL + '=' + rev);
     }
 };