pref UI for middle click on the new tab button should be hidden on Firefox 3.6

This commit is contained in:
SHIMODA Hiroshi 2011-05-25 12:47:38 +09:00
parent e5e96b92da
commit 7c71359f2d
4 changed files with 11 additions and 3 deletions

View File

@ -162,6 +162,12 @@ function initTabPane()
'openGroupBookmark-check', 'openGroupBookmark-check',
'openGroupBookmark-deck' 'openGroupBookmark-deck'
); );
var newTabPref = document.getElementById('extensions.treestyletab.autoAttach.newTabButton-box');
if (comparator.compare(XULAppInfo.version, '4.0') >= 0)
newTabPref.removeAttribute('hidden');
else
newTabPref.setAttribute('hidden', true);
} }
function onSyncGroupBookmarkUIToPref() function onSyncGroupBookmarkUIToPref()

View File

@ -381,7 +381,7 @@
<label value="&config.autoAttach.newTabCommand.label_after;" <label value="&config.autoAttach.newTabCommand.label_after;"
control="extensions.treestyletab.autoAttach.newTabCommand-menulist"/> control="extensions.treestyletab.autoAttach.newTabCommand-menulist"/>
</hbox> </hbox>
<hbox align="center"> <hbox align="center" id="extensions.treestyletab.autoAttach.newTabButton-box">
<label value="&config.autoAttach.newTabButton.label_before;" <label value="&config.autoAttach.newTabButton.label_before;"
control="extensions.treestyletab.autoAttach.newTabButton-menulist"/> control="extensions.treestyletab.autoAttach.newTabButton-menulist"/>
<menulist id="extensions.treestyletab.autoAttach.newTabButton-menulist" <menulist id="extensions.treestyletab.autoAttach.newTabButton-menulist"

View File

@ -785,7 +785,7 @@ var TreeStyleTabService = {
var tabbar = this.getTabStrip(this.browser); var tabbar = this.getTabStrip(this.browser);
tabbar.addEventListener('click', this, true); tabbar.addEventListener('click', this, true);
var newTabButton = document.getElementById('new-tab-button'); // Firefox 4 or later var newTabButton = document.getElementById('new-tab-button');
if (newTabButton && if (newTabButton &&
!(tabbar.compareDocumentPosition(newTabButton) & Ci.nsIDOM3Node.DOCUMENT_POSITION_CONTAINED_BY)) !(tabbar.compareDocumentPosition(newTabButton) & Ci.nsIDOM3Node.DOCUMENT_POSITION_CONTAINED_BY))
newTabButton.parentNode.addEventListener('click', this, true); newTabButton.parentNode.addEventListener('click', this, true);
@ -808,7 +808,7 @@ var TreeStyleTabService = {
var tabbar = this.getTabStrip(this.browser); var tabbar = this.getTabStrip(this.browser);
tabbar.removeEventListener('click', this, true); tabbar.removeEventListener('click', this, true);
var newTabButton = document.getElementById('new-tab-button'); // Firefox 4 or later var newTabButton = document.getElementById('new-tab-button');
if (newTabButton && if (newTabButton &&
!(tabbar.compareDocumentPosition(newTabButton) & Ci.nsIDOM3Node.DOCUMENT_POSITION_CONTAINED_BY)) !(tabbar.compareDocumentPosition(newTabButton) & Ci.nsIDOM3Node.DOCUMENT_POSITION_CONTAINED_BY))
newTabButton.parentNode.removeEventListener('click', this, true); newTabButton.parentNode.removeEventListener('click', this, true);

View File

@ -450,6 +450,8 @@ pref("extensions.treestyletab.autoAttach.newTabCommand", 0);
/** /**
* How to treat new tabs from middle click (or Ctrl-click) on the "New Tab" button. * How to treat new tabs from middle click (or Ctrl-click) on the "New Tab" button.
* Options are same to extensions.treestyletab.autoAttach.newTabCommand. * Options are same to extensions.treestyletab.autoAttach.newTabCommand.
* NOTE: This pref affects only on Firefox 4 or later. Firefox 3.6 doesn't open
* new blank tabs by middle click on the "New Tab" button.
*/ */
pref("extensions.treestyletab.autoAttach.newTabButton", 0); pref("extensions.treestyletab.autoAttach.newTabButton", 0);
/** /**