Comments (2)
Hi @samuelmeuli !
Thank you so much for your fast answer !
Awesome, that works now !
I didn't know this syntax (not loving much JS :P)
Now I got everything I need, doing the following code works like a charm :
$(document).on('turbolinks:load', function() {
const fontPickerTitle = new FontPicker(
'xxxxxxxxxxxxxxx',
"Ubuntu",
{ pickerId: "title" },
() => {
if(typeof fontPickerTitle !== 'undefined') {
console.log(fontPickerTitle.getActiveFont().family);
}
},
);
})
Thank you !
from font-picker.
Hi @webmix,
Try this:
import FontPicker from "font-picker/dist/FontPicker.js";
$(document).on('turbolinks:load', function() {
const fontPickerTitle = new FontPicker(
'xxxxxxxxxxxxxxxx',
"Ubuntu",
{ pickerId: "title" },
- { onChange: console.log('test') }
+ () => {
+ console.log('test');
+ },
);
})
Let me know if this works for you :)
from font-picker.
Related Issues (20)
- Option to configure colors HOT 1
- Standard fonts HOT 2
- Calling `setActiveFont` after constructor does not work HOT 3
- Set "Not selected" HOT 7
- Fonts from custom URL HOT 1
- Font loaded callback HOT 1
- Webpack and Array.from(fontMap.values()); HOT 2
- `font-manager` dependency not found HOT 2
- I want to change the font-picker styles HOT 3
- Option keys aren't optional with TypeScript HOT 1
- Document not defined HOT 1
- js file not available HOT 3
- onChange event is sent before the font is loaded HOT 1
- Feature request: Search by name
- Uncaught TypeError: Cannot read property 'pickerId' of undefined HOT 2
- Option to reset the picker font back to default
- How to removed font families onload
- Missing Characters
- Bump react version??
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from font-picker.