Bug 1148893 - Return the style sheet selection promise to the caller. r=ejpbruel

This commit is contained in:
Sami Jaktholm 2015-03-28 07:22:50 +02:00
parent b3cb9a8b9c
commit 63f9ca53ff
2 changed files with 10 additions and 3 deletions

View File

@ -632,7 +632,8 @@ StyleEditorUI.prototype = {
* @param {number} col
* Column number to jump to
* @return {Promise}
* Promise that will resolve when the editor is selected.
* Promise that will resolve when the editor is selected and ready
* to be used.
*/
_selectEditor: function(editor, line, col) {
line = line || 0;
@ -707,6 +708,9 @@ StyleEditorUI.prototype = {
* Line to which the caret should be moved (zero-indexed).
* @param {Number} [col]
* Column to which the caret should be moved (zero-indexed).
* @return {Promise}
* Promise that will resolve when the editor is selected and ready
* to be used.
*/
selectStyleSheet: function(stylesheet, line, col) {
this._styleSheetToSelect = {
@ -717,7 +721,7 @@ StyleEditorUI.prototype = {
/* Switch to the editor for this sheet, if it exists yet.
Otherwise each editor will be checked when it's created. */
this.switchToSelectedSheet();
return this.switchToSelectedSheet();
},

View File

@ -110,12 +110,15 @@ StyleEditorPanel.prototype = {
* Line number to jump to after selecting. One-indexed
* @param {number} col
* Column number to jump to after selecting. One-indexed
* @return {Promise}
* Promise that will resolve when the editor is selected and ready
* to be used.
*/
selectStyleSheet: function(href, line, col) {
if (!this._debuggee || !this.UI) {
return;
}
this.UI.selectStyleSheet(href, line - 1, col ? col - 1 : 0);
return this.UI.selectStyleSheet(href, line - 1, col ? col - 1 : 0);
},
/**