diff --git a/chrome/content/scaffold/scaffold.js b/chrome/content/scaffold/scaffold.js index cbb4c2a56a..849d16eaff 100644 --- a/chrome/content/scaffold/scaffold.js +++ b/chrome/content/scaffold/scaffold.js @@ -428,7 +428,19 @@ var Scaffold = new function() { yield Zotero.Translators.reinit(); } }); - + + this.handleTabSelect = function (event) { + // Focus editor when switching to tab + var tab = event.target.selectedItem.id.match(/^tab-(.+)$/)[1]; + switch (tab) { + case 'import': + case 'code': + case 'tests': + _editors[tab].focus(); + break; + } + }; + /* * add template code */ diff --git a/chrome/content/scaffold/scaffold.xul b/chrome/content/scaffold/scaffold.xul index 34961458bd..5e6ab276c8 100644 --- a/chrome/content/scaffold/scaffold.xul +++ b/chrome/content/scaffold/scaffold.xul @@ -97,7 +97,7 @@ - +