Bug 668760 - Factor out method to get weave engine (r=mbrubeck)

This commit is contained in:
Lucas Rocha 2011-08-23 09:16:03 -07:00
parent aed526341f
commit 57e277cdee

View File

@ -1427,16 +1427,22 @@
<field name="scrollBoxObject">this._children.scrollBoxObject</field>
<method name="_getWeaveEngine">
<body><![CDATA[
// Return null if the Weave isn't ready
if (document.getElementById("cmd_remoteTabs").getAttribute("disabled") == "true")
return null;
if (Weave.Status.checkSetup() == Weave.CLIENT_NOT_CONFIGURED)
return null;
return Weave.Engines.get("tabs");
]]></body>
</method>
<method name="_getRemoteTabs">
<body><![CDATA[
// Don't do anything if the Weave isn't ready
if (document.getElementById("cmd_remoteTabs").getAttribute("disabled") == "true")
return [];
if (Weave.Status.checkSetup() == Weave.CLIENT_NOT_CONFIGURED)
return [];
// Don't do anything if the tabs engine isn't ready
let engine = Weave.Engines.get("tabs");
let engine = this._getWeaveEngine();
if (!engine)
return [];