Skip to content

Commit e519236

Browse files
committed
Removed external fonts from page forms and remove initial form flicker
1 parent 5bf811a commit e519236

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

resources/assets/js/pages/page-form.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
module.exports = {
22
selector: '#html-editor',
33
content_css: [
4-
'/css/styles.css',
5-
'//fonts.googleapis.com/css?family=Roboto:400,400italic,500,500italic,700,700italic,300italic,100,300'
4+
'/css/styles.css'
65
],
76
body_class: 'page-content',
87
relative_urls: false,
@@ -133,14 +132,15 @@ module.exports = {
133132
formData.append('file', file, remoteFilename);
134133
formData.append('_token', document.querySelector('meta[name="token"]').getAttribute('content'));
135134

136-
xhr.open('POST', '/upload/image');
135+
xhr.open('POST', '/images/gallery/upload');
137136
xhr.onload = function () {
138137
if (xhr.status === 200 || xhr.status === 201) {
139138
var result = JSON.parse(xhr.responseText);
140139
editor.dom.setAttrib(id, 'src', result.url);
141140
} else {
142141
console.log('An error occured uploading the image');
143142
console.log(xhr.responseText);
143+
editor.dom.remove(id);
144144
}
145145
};
146146
xhr.send(formData);

resources/assets/sass/_forms.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
}
2323
}
2424

25+
#html-editor {
26+
display: none;
27+
}
28+
2529
label {
2630
display: block;
2731
line-height: 1.4em;

0 commit comments

Comments
 (0)