Skip to content

Commit

Permalink
pkp/pkp-lib#3594 Only load NotoSans font in TinyMCE when enable_cdn i…
Browse files Browse the repository at this point in the history
…s true
  • Loading branch information
NateWr committed Jun 4, 2018
1 parent dccc046 commit 8468a51
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/components/Form/fields/FieldRichTextarea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ export default {
menubar: false,
statusbar: false,
entity_encoding: 'raw',
content_css: '/static/tinymce-content.css',
};
},
},
Expand All @@ -87,8 +86,13 @@ export default {
* @return Object
*/
compiledInit: function () {
let contentCSS = '/static/tinymce-content.css';
if ($.pkp.app.cdnEnabled) {
contentCSS = contentCSS + ', /static/tinymce-content-font.css';
}
return {
height: this.size === 'large' ? 500 : 200,
content_css: contentCSS,
...this.init,
};
},
Expand Down
1 change: 1 addition & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ window.$.pkp = {
app: {
currentLocale: 'en_US',
primaryLocale: 'en_US',
cdnEnabled: true,
formLocales: [
{
key: 'en_US',
Expand Down
1 change: 1 addition & 0 deletions static/tinymce-content-font.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import url('//fonts.googleapis.com/css?family=Noto+Sans:400,400italic,700,700italic');
2 changes: 0 additions & 2 deletions static/tinymce-content.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@import url('//fonts.googleapis.com/css?family=Noto+Sans:400,400italic,700,700italic');

body {
font-family: "Noto Sans", Arial, Helvetica, sans-serif;
font-size: 14px;
Expand Down

0 comments on commit 8468a51

Please sign in to comment.