Bug 608714 - Unable to edit tab group names [r=dolske, a=beltzner]
authorRaymond Lee <raymond@raysquare.com>
Wed, 24 Nov 2010 01:57:30 +0800
changeset 58276 fa69cf56d15bfc04871444f9b7bdfc972e03c612
parent 58275 d6e9599f18bf28431add961995fd97ebb7e9e6bc
child 58277 bc8a510004f0f3ee615b1a54569713cd4ac1cc80
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersdolske, beltzner
bugs608714
milestone2.0b8pre
Bug 608714 - Unable to edit tab group names [r=dolske, a=beltzner]
browser/base/content/tabview/groupitems.js
browser/base/content/tabview/ui.js
--- a/browser/base/content/tabview/groupitems.js
+++ b/browser/base/content/tabview/groupitems.js
@@ -135,17 +135,17 @@ function GroupItem(listOfEls, options) {
   this.$resizer = iQ("<div>")
     .addClass('resizer')
     .appendTo($container)
     .hide();
 
   // ___ Titlebar
   var html =
     "<div class='title-container'>" +
-      "<input class='name'/>" +
+      "<input class='name' />" +
       "<div class='title-shield' />" +
     "</div>";
 
   this.$titlebar = iQ('<div>')
     .addClass('titlebar')
     .html(html)
     .appendTo($container);
 
--- a/browser/base/content/tabview/ui.js
+++ b/browser/base/content/tabview/ui.js
@@ -135,17 +135,18 @@ let UI = {
         self.blurAll();
       });
 
       // When you click on the background/empty part of TabView,
       // we create a new groupItem.
       iQ(gTabViewFrame.contentDocument).mousedown(function(e) {
         if (iQ(":focus").length > 0) {
           iQ(":focus").each(function(element) {
-            if (element.nodeName == "INPUT")
+            // don't fire blur event if the same input element is clicked.
+            if (e.target != element && element.nodeName == "INPUT")
               element.blur();
           });
         }
         if (e.originalTarget.id == "content")
           self._createGroupItemOnDrag(e)
       });
 
       iQ(window).bind("beforeunload", function() {
@@ -838,17 +839,18 @@ let UI = {
       if (!event.metaKey) 
         Keys.meta = false;
     });
 
     iQ(window).keydown(function(event) {
       if (event.metaKey) 
         Keys.meta = true;
 
-      if (isSearchEnabled())
+      if ((iQ(":focus").length > 0 && iQ(":focus")[0].nodeName == "INPUT") || 
+          isSearchEnabled())
         return;
 
       function getClosestTabBy(norm) {
         if (!self.getActiveTab())
           return null;
         var centers =
           [[item.bounds.center(), item]
              for each(item in TabItems.getItems()) if (!item.parent || !item.parent.hidden)];