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
Родитель b3cb9a8b9c
Коммит 63f9ca53ff
2 изменённых файлов: 10 добавлений и 3 удалений

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

@ -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();
},

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

@ -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);
},
/**