Bug 294673 followup, use switch instead of multiple schemeIs()s, r=brendan

This commit is contained in:
gavin%gavinsharp.com 2005-10-13 03:29:50 +00:00
Родитель be553a1f91
Коммит 84cd2aae7f
1 изменённых файлов: 9 добавлений и 7 удалений

Просмотреть файл

@ -48,14 +48,16 @@ var reporterListener = {
onLocationChange: function(aProgress, aRequest, aURI) {
var broadcaster = document.getElementById("reporterItemsBroadcaster");
// XXX The schemeIs check is only necessary until bug 169826 is fixed,
// since we can end up with a dummy URI here
var isEnabled = (aURI && "schemeIs" in aURI &&
(aURI.schemeIs("http") ||
aURI.schemeIs("https") ||
aURI.schemeIs("ftp") ||
aURI.schemeIs("gopher")));
var isEnabled = false;
switch (aURI.scheme) {
case "http":
case "https":
case "ftp":
case "gopher":
isEnabled = true;
}
broadcaster.setAttribute("disabled", !isEnabled);
},