don't show "replace current tab" item for bookmark groups on Firefox 8 or later (fix for https://bugzilla.mozilla.org/show_bug.cgi?id=440093 )

This commit is contained in:
SHIMODA Hiroshi 2011-08-24 10:20:31 +09:00
parent 85ef4d852f
commit 68e156bd12
3 changed files with 19 additions and 4 deletions

View File

@ -277,10 +277,14 @@ var TreeStyleTabBookmarksService = {
else {
sv.readyToOpenNewTabGroup(null, treeStructure, TSTOpenGroupBookmarkBehavior & sv.kGROUP_BOOKMARK_EXPAND_ALL_TREE);
}
replaceCurrentTab = false;
// replaceCurrentTab works only on Firefox 7 or earlier
// See: https://bugzilla.mozilla.org/show_bug.cgi?id=440093
if (typeof replaceCurrentTab !== 'undefined')
replaceCurrentTab = false;
}
else {
replaceCurrentTab = !!(TSTOpenGroupBookmarkBehavior & sv.kGROUP_BOOKMARK_REPLACE);
if (typeof replaceCurrentTab !== 'undefined')
replaceCurrentTab = !!(TSTOpenGroupBookmarkBehavior & sv.kGROUP_BOOKMARK_REPLACE);
}
}
$1

View File

@ -168,6 +168,16 @@ function initTabPane()
newTabPref.removeAttribute('hidden');
else
newTabPref.setAttribute('hidden', true);
var bookmarkGroupReplacePref = document.getElementById('openGroupBookmark.replace');
if (comparator.compare(XULAppInfo.version, '7.0') > 0) {
if (bookmarkGroupReplacePref.selected)
document.getElementById('openGroupBookmark.subtree').selected = true;
bookmarkGroupReplacePref.setAttribute('hidden', true);
}
else {
bookmarkGroupReplacePref.removeAttribute('hidden');
}
}
function onSyncGroupBookmarkUIToPref()

View File

@ -446,7 +446,7 @@
onsyncfrompreference="return onSyncGroupBookmarkPrefToUI();"
preference="extensions.treestyletab.openGroupBookmark.behavior">
<radio value="0" collapsed="true"/>
<radio value="1" label="&config.openGroupBookmark.subtree;"/>
<radio id="openGroupBookmark.subtree" value="1" label="&config.openGroupBookmark.subtree;"/>
<hbox>
<spacer style="width:1em;"/>
<vbox>
@ -471,7 +471,8 @@
</vbox>
</hbox>
<radio value="2" label="&config.openGroupBookmark.flat;"/>
<radio value="4" label="&config.openGroupBookmark.replace;"/>
<radio id="openGroupBookmark.replace"
value="4" label="&config.openGroupBookmark.replace;"/>
</radiogroup>
</vbox>
</deck>