Bug 1160774 - Don't wait for 'stylesheet-selected' event in source-utils.js as it is not emitted if the requested sheet is already selected. r=jsantell

The promise returned by selectStyleSheet resolves about the same time as the
'stylesheet-selected' event would be emitted so there's no need to wait for the
actual event that might never come.
This commit is contained in:
Sami Jaktholm
2015-05-23 21:49:50 +03:00
parent eda69fead2
commit 6afd957918

View File

@@ -25,10 +25,8 @@ exports.viewSourceInStyleEditor = Task.async(function *(toolbox, sourceURL, sour
let panel = yield toolbox.loadTool("styleeditor");
try {
let selected = panel.UI.once("editor-selected");
yield panel.selectStyleSheet(sourceURL, sourceLine);
yield toolbox.selectTool("styleeditor");
yield selected;
return true;
} catch (e) {
exports.viewSource(toolbox, sourceURL, sourceLine);