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 58105 b27ab9bbc12efd1584626e809955360ee35e10b7
parent 58104 1698f57029c4eb36a7e05b88bad716656e3a8eea
child 58106 041430229f5ea29a136f496206d026d09f6ac348
push id17157
push userian@iangilman.com
push dateTue, 23 Nov 2010 22:33:58 +0000
treeherdermozilla-central@597e4c5ded14 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdolske, beltzner
bugs608714
milestone2.0b8pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
@@ -143,17 +143,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
@@ -143,17 +143,18 @@ let UI = {
       if (false)
         this._addDevMenu();
 
       // 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() {
@@ -849,17 +850,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)];