mirror of
https://github.com/avwo/whistle.git
synced 2026-10-29 15:09:28 +08:00
fix: plugin custom inspector tab hidden by display:none
In TabMgr.render(), the container div's className (including util.getHide(hideAll)) was evaluated before props.tabs.map() ran. Since hideAll was still its initial value true at that point, the container always carried the 'hide' class (display:none), making all plugin custom inspector tabs (declared via whistleConfig.inspectorsTab) render but remain invisible. Evaluate getHide() after the map() callback has corrected hideAll, restoring the 2.10.7 semantics.
This commit is contained in:
@@ -57,6 +57,23 @@ var TabMgr = React.createClass({
|
||||
var hide = props.hide;
|
||||
var active = props.active;
|
||||
var hideAll = true;
|
||||
var tabs = props.tabs.map(function (tab) {
|
||||
var plugin = tab.plugin;
|
||||
var hideTab = hide || active !== plugin;
|
||||
if (!hideTab) {
|
||||
hideAll = false;
|
||||
}
|
||||
return (
|
||||
self.isInited(tab) && (
|
||||
<TabFrame
|
||||
ref={plugin}
|
||||
key={plugin}
|
||||
src={tab.action}
|
||||
hide={hideTab}
|
||||
/>
|
||||
)
|
||||
);
|
||||
});
|
||||
return (
|
||||
<div
|
||||
className={
|
||||
@@ -65,23 +82,7 @@ var TabMgr = React.createClass({
|
||||
util.getHide(hideAll)
|
||||
}
|
||||
>
|
||||
{props.tabs.map(function (tab) {
|
||||
var plugin = tab.plugin;
|
||||
var hideTab = hide || active !== plugin;
|
||||
if (!hideTab) {
|
||||
hideAll = false;
|
||||
}
|
||||
return (
|
||||
self.isInited(tab) && (
|
||||
<TabFrame
|
||||
ref={plugin}
|
||||
key={plugin}
|
||||
src={tab.action}
|
||||
hide={hideTab}
|
||||
/>
|
||||
)
|
||||
);
|
||||
})}
|
||||
{tabs}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user