changeset 414:ae598511850d

browser_side: set microblog editor minimal width + fix the scrolling to comment
author souliane <souliane@mailoo.org>
date Fri, 21 Mar 2014 09:20:27 +0100
parents 7a8991cda2fa
children fadbba1d793f
files browser_side/panels.py public/libervia.css
diffstat 2 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/browser_side/panels.py	Thu Mar 20 22:16:02 2014 +0100
+++ b/browser_side/panels.py	Fri Mar 21 09:20:27 2014 +0100
@@ -470,12 +470,19 @@
 
     def onClick(self, sender):
         if sender == self:
+            try:  # prevent re-selection of the main entry after a comment has been focused
+                if self.__ignoreNextEvent:
+                    self.__ignoreNextEvent = False
+                    return
+            except AttributeError:
+                pass
             self._blog_panel.setSelectedEntry(self)
         elif sender == self.delete_label:
             self._delete()
         elif sender == self.update_label:
             self.edit(True)
         elif sender == self.comment_label:
+            self.__ignoreNextEvent = True
             self._comment()
 
     def __modifiedCb(self, content):
@@ -566,6 +573,7 @@
         """Add an empty entry for a new comment"""
         if self._current_comment:
             self._current_comment.bubble.setFocus(True)
+            self._blog_panel.setSelectedEntry(self._current_comment)
             return
         data = {'id': str(time()),
                 'new': True,
@@ -581,6 +589,7 @@
         entry._parent_entry = self
         self._current_comment = entry
         self.edit(True, entry)
+        self._blog_panel.setSelectedEntry(entry)
 
     def edit(self, edit, entry=None):
         """Toggle the bubble between display and edit mode
--- a/public/libervia.css	Thu Mar 20 22:16:02 2014 +0100
+++ b/public/libervia.css	Fri Mar 21 09:20:27 2014 +0100
@@ -883,12 +883,9 @@
     width: 20;
 }
 
-.bubble-editbox {
+.bubble textarea{
     width: 100%;
-}
-
-.bubble-editbox textarea{
-    width: 100%;
+    min-width: 300px;
 }
 
 .mb_entry_timestamp {