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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user