[views/treeview] fix non-ITree nodes last element computation stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Thu, 04 Feb 2010 11:33:55 +0100
branchstable
changeset 4455 6af31772765f
parent 4454 aba1b563705b
child 4456 e0ee73794898
[views/treeview] fix non-ITree nodes last element computation
web/views/treeview.py
--- a/web/views/treeview.py	Thu Feb 04 11:33:09 2010 +0100
+++ b/web/views/treeview.py	Thu Feb 04 11:33:55 2010 +0100
@@ -112,10 +112,8 @@
         assert treeid is not None
         entity = self.entity(row, col)
         itemview = self.view(vid, self.rset, row=row, col=col)
-        if row == len(self.rset) - 1:
-            self.w(u'<li class="last">%s</li>' % itemview)
-        else:
-            self.w(u'<li>%s</li>' % itemview)
+        last_class = morekwargs['is_last'] and ' class="last"' or ''
+        self.w(u'<li%s>%s</li>' % (last_class, itemview))
 
 
 class TreeViewItemView(EntityView):