font-picker
Advanced tools
Comparing version 3.0.1 to 3.0.2
@@ -15,4 +15,4 @@ import { Font, FontList, Options } from "../shared/types"; | ||
getActiveFont(): Font; | ||
setActiveFont(fontFamily: string): void; | ||
setActiveFont(fontFamily: string, runOnChange?: boolean): void; | ||
} | ||
//# sourceMappingURL=FontManager.d.ts.map |
@@ -296,3 +296,3 @@ (function (global, factory) { | ||
this.addFont(defaultFamily, false); | ||
this.setActiveFont(defaultFamily); | ||
this.setActiveFont(defaultFamily, false); | ||
} | ||
@@ -356,4 +356,5 @@ FontManager.prototype.init = function () { | ||
}; | ||
FontManager.prototype.setActiveFont = function (fontFamily) { | ||
FontManager.prototype.setActiveFont = function (fontFamily, runOnChange) { | ||
var _this = this; | ||
if (runOnChange === void 0) { runOnChange = true; } | ||
if (!this.fonts.has(fontFamily)) { | ||
@@ -366,3 +367,7 @@ console.error("Cannot update active font: \"" + fontFamily + "\" is not in the font list"); | ||
this.activeFontFamily = fontFamily; | ||
loadActiveFont(activeFont, previousFontFamily, this.options.scripts, this.options.variants, this.selectorSuffix).then(function () { return _this.onChange(activeFont); }); | ||
loadActiveFont(activeFont, previousFontFamily, this.options.scripts, this.options.variants, this.selectorSuffix).then(function () { | ||
if (runOnChange) { | ||
_this.onChange(activeFont); | ||
} | ||
}); | ||
}; | ||
@@ -369,0 +374,0 @@ return FontManager; |
@@ -15,4 +15,4 @@ import { Font, FontList, Options } from "../shared/types"; | ||
getActiveFont(): Font; | ||
setActiveFont(fontFamily: string): void; | ||
setActiveFont(fontFamily: string, runOnChange?: boolean): void; | ||
} | ||
//# sourceMappingURL=FontManager.d.ts.map |
@@ -296,3 +296,3 @@ (function (global, factory) { | ||
this.addFont(defaultFamily, false); | ||
this.setActiveFont(defaultFamily); | ||
this.setActiveFont(defaultFamily, false); | ||
} | ||
@@ -356,4 +356,5 @@ FontManager.prototype.init = function () { | ||
}; | ||
FontManager.prototype.setActiveFont = function (fontFamily) { | ||
FontManager.prototype.setActiveFont = function (fontFamily, runOnChange) { | ||
var _this = this; | ||
if (runOnChange === void 0) { runOnChange = true; } | ||
if (!this.fonts.has(fontFamily)) { | ||
@@ -366,3 +367,7 @@ console.error("Cannot update active font: \"" + fontFamily + "\" is not in the font list"); | ||
this.activeFontFamily = fontFamily; | ||
loadActiveFont(activeFont, previousFontFamily, this.options.scripts, this.options.variants, this.selectorSuffix).then(function () { return _this.onChange(activeFont); }); | ||
loadActiveFont(activeFont, previousFontFamily, this.options.scripts, this.options.variants, this.selectorSuffix).then(function () { | ||
if (runOnChange) { | ||
_this.onChange(activeFont); | ||
} | ||
}); | ||
}; | ||
@@ -369,0 +374,0 @@ return FontManager; |
{ | ||
"name": "font-picker", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "Font selector component for Google Fonts", | ||
@@ -5,0 +5,0 @@ "author": "Samuel Meuli <me@samuelmeuli.com>", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
124359
1046