Skip to content

Commit 51bccf8

Browse files
author
Dennis Suitters
authored
Merge pull request #68 from umutto/master
add documentation for inheritPlaceholder and addDefaultFonts options
2 parents 4b4288a + e2156d6 commit 51bccf8

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

01-deep-dive.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,15 @@ $('#summernote').summernote({
197197
});
198198
{% endhighlight %}
199199

200+
Summernote automatically populates the font dropdown with the available fonts that are given on `fontNames` option. This includes the font set on the current dom element. If you only want to display a specific list of fonts on the dropdown, you can set the `addDefaultFonts` option to `false` along with the `fontNames` option. Example settings below will only add Arial and Arial Black fonts to the dropdown.
201+
202+
{% highlight javascript %}
203+
$('#summernote').summernote({
204+
fontNames: ['Arial', 'Arial Black'],
205+
addDefaultFonts: false
206+
});
207+
{% endhighlight %}
208+
200209
### Custom font size units
201210
You can set the available font size units with the `fontSizeUnits` option.
202211

@@ -224,6 +233,21 @@ $('#summernote').summernote({
224233
});
225234
{% endhighlight %}
226235

236+
Summernote can also be set to inherit the placeholder from the `placeholder` attribute on the dom element.
237+
238+
{% highlight html %}
239+
<div class="summernote" placeholder="first placeholder"></div>
240+
<div class="summernote" placeholder="second placeholder"></div>
241+
{% endhighlight %}
242+
243+
And then set the `inheritPlaceholder` option as `true` during initialization.
244+
245+
{% highlight javascript %}
246+
$('.summernote').summernote({
247+
inheritPlaceholder: true
248+
});
249+
{% endhighlight %}
250+
227251
### Dialogs
228252
Dialogs can be placed in `body`, not within Summernote. If you're using Summernote within a modal dialog, please set this option as `true`.
229253
{% highlight javascript %}

0 commit comments

Comments
 (0)