# HG changeset patch # User souliane # Date 1448473237 -3600 # Node ID 5b28bca05d236dd81663e302fbfd60a990e40680 # Parent 6c89dfdba5635a042a210729f49f62d7d27bb227 browser_side (blog): fixes focusing new comment box + click listener diff -r 6c89dfdba563 -r 5b28bca05d23 src/browser/sat_browser/blog.py --- a/src/browser/sat_browser/blog.py Wed Nov 25 17:03:36 2015 +0100 +++ b/src/browser/sat_browser/blog.py Wed Nov 25 18:40:37 2015 +0100 @@ -170,11 +170,15 @@ if self.item.comments: self.comment_label = addIcon(u"↶", "Comment this message") self.comment_label.setStyleName('mb_entry_action_larger') + else: + self.comment_label = None is_publisher = self.item.author_jid == self.blog.host.whoami.bare if is_publisher: self.update_label = addIcon(u"✍", "Edit this message") # TODO: add delete button if we are the owner of the node self.delete_label = addIcon(u"✗", "Delete this message") + else: + self.update_label = self.delete_label = None def _createCommentsPanel(self): """Create the panel if it doesn't exists""" @@ -323,7 +327,7 @@ """Add an empty entry for a new comment""" if self._current_comment is None: if not self.item.comments_service or not self.item.comments_node: - log.warning("Invalid service and node for comments, can pcreate a comment") + log.warning("Invalid service and node for comments, can't create a comment") self._current_comment = self.addEntry(editable=True, service=self.item.comments_service, node=self.item.comments_node) self.blog.setSelectedEntry(self._current_comment, True) @@ -497,7 +501,7 @@ log.warning("Can't find any parent ScrollPanel") return elif isinstance(parent, ScrollPanel): - parent.ensureVisible(current) + parent.ensureVisible(entry) return else: current = parent