Fix JavaScript error on pages without headings

Error was caused because .css( 'font-family' ) returns undefined for
elements which do not exist.

Merged two blocks both extending the default settings.

Bug: 67676
Change-Id: Ic33f3934166f4feb6dd088ca0d14e249fcf237a3