Fix FontPicker (forgot to update copy)
This commit is contained in:
parent
cc1a5d5945
commit
5fe87cbfc1
@ -37,8 +37,9 @@ define("webodf/editor/widgets/fontPicker", [], function () {
|
|||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
var FontPicker = function (editorSession, callback) {
|
var FontPicker = function (callback) {
|
||||||
var self = this,
|
var self = this,
|
||||||
|
editorSession,
|
||||||
select,
|
select,
|
||||||
editorFonts = [],
|
editorFonts = [],
|
||||||
documentFonts = [],
|
documentFonts = [],
|
||||||
@ -77,8 +78,8 @@ define("webodf/editor/widgets/fontPicker", [], function () {
|
|||||||
|
|
||||||
function populateFonts() {
|
function populateFonts() {
|
||||||
var i, name, family;
|
var i, name, family;
|
||||||
editorFonts = editorSession.availableFonts;
|
editorFonts = editorSession ? editorSession.availableFonts : [];
|
||||||
documentFonts = editorSession.getDeclaredFonts();
|
documentFonts = editorSession ? editorSession.getDeclaredFonts() : [];
|
||||||
|
|
||||||
// First populate the fonts used in the document
|
// First populate the fonts used in the document
|
||||||
for (i = 0; i < documentFonts.length; i += 1) {
|
for (i = 0; i < documentFonts.length; i += 1) {
|
||||||
@ -107,6 +108,12 @@ define("webodf/editor/widgets/fontPicker", [], function () {
|
|||||||
select.addOption(selectionList);
|
select.addOption(selectionList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.setEditorSession = function(session) {
|
||||||
|
editorSession = session;
|
||||||
|
populateFonts();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
function init(cb) {
|
function init(cb) {
|
||||||
require(["dijit/form/Select"], function (Select) {
|
require(["dijit/form/Select"], function (Select) {
|
||||||
select = new Select({
|
select = new Select({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user