Truncate overly long search query text in dimp
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 19 Nov 2010 20:10:43 +0000 (13:10 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 19 Nov 2010 20:10:49 +0000 (13:10 -0700)
imp/js/dimpbase.js

index cc22592..6d83329 100644 (file)
@@ -583,7 +583,12 @@ var DimpBase = {
                 }
 
                 if (tmp) {
-                    $('search_label').update(tmp.stripTags().escapeHTML());
+                    tmp = tmp.stripTags();
+                    $('search_label').writeAttribute({ title: tmp.escapeHTML() });
+                    if (tmp.length > 250) {
+                        tmp = tmp.truncate(250);
+                    }
+                    $('search_label').update(tmp.escapeHTML());
                 }
                 [ $('search_edit') ].invoke(this.search || this.viewport.getMetaData('noedit') ? 'hide' : 'show');
                 $('searchbar').show();