Tab Mix Plusでタブバーを複数行表示している時はインデントの方法を変えるようにした
git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@1816 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
parent
3bc824a0cb
commit
2ae7043475
@ -393,6 +393,10 @@ TreeStyleTabService.overrideExtensionsAfterInit = function() {
|
||||
'tabBarScrollStatus(); $&'
|
||||
)
|
||||
);
|
||||
TreeStyleTabBrowser.prototype.isMultiRow = function()
|
||||
{
|
||||
return window.tabscroll == 2;
|
||||
};
|
||||
|
||||
window.setTimeout(function() {
|
||||
// correct broken appearance of the first tab
|
||||
|
@ -77,6 +77,11 @@ TreeStyleTabBrowser.prototype = {
|
||||
tabBox.screenY + tabBox.height <= barBox.screenY + barBox.height);
|
||||
},
|
||||
|
||||
isMultiRow : function()
|
||||
{
|
||||
return false;
|
||||
},
|
||||
|
||||
/* initialize */
|
||||
|
||||
init : function()
|
||||
@ -1905,9 +1910,23 @@ TreeStyleTabBrowser.prototype = {
|
||||
var margin = this.levelMargin < 0 ? this.baseLebelMargin : this.levelMargin ;
|
||||
var indent = margin * aLevel;
|
||||
|
||||
var multirow = this.isMultiRow();
|
||||
var topBottom = this.levelMarginProp.match(/top|bottom/);
|
||||
var innerBoxes, j;
|
||||
|
||||
for (var i = 0, maxi = aTabs.length; i < maxi; i++)
|
||||
{
|
||||
if (multirow) {
|
||||
innerBoxes = document.getAnonymousNodes(aTabs[i]);
|
||||
for (j = 0, maxj = innerBoxes.length; j < maxj; j++)
|
||||
{
|
||||
if (innerBoxes[j].nodeType != Node.ELEMENT_NODE) continue;
|
||||
innerBoxes[j].setAttribute('style', innerBoxes[j].getAttribute('style').replace(/border-(top|bottom).*:[^;]+;?/g, '')+'; border-'+topBottom+': solid transparent '+(aLevel * 4)+'px !important;');
|
||||
}
|
||||
}
|
||||
else {
|
||||
aTabs[i].setAttribute('style', aTabs[i].getAttribute('style').replace(/margin(-[^:]+):[^;]+;?/g, '')+'; '+aProp+':'+indent+'px !important;');
|
||||
}
|
||||
aTabs[i].setAttribute(this.kNEST, aLevel);
|
||||
this.updateTabsIndent(this.getChildTabs(aTabs[i]), aLevel+1, aProp);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user