Skip to content
This repository was archived by the owner on Jul 23, 2020. It is now read-only.

Commit bf0e199

Browse files
committed
Retrieve custom CSS from the settings object.
/cc @barisusakli
1 parent 7888963 commit bf0e199

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

index.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,14 @@ function setCustomCSS(uid, customCSS, callback) {
2626
}
2727

2828
plugin.addCustomSetting = function(data, callback) {
29-
getCustomCSS(data.uid, function(err, customCSS) {
30-
if (err) {
31-
return callback(err);
32-
}
33-
34-
data.customSettings.push({
35-
'title': 'Custom CSS',
36-
'content': '<textarea data-property="customCSS" class="form-control" type="textarea">' + validator.escape(customCSS) + '</textarea><p class="help-block">Requires a refresh to take effect.</p>'
37-
});
29+
var customCSS = data.settings.customCSS || '';
3830

39-
callback(null, data);
31+
data.customSettings.push({
32+
'title': 'Custom CSS',
33+
'content': '<textarea data-property="customCSS" class="form-control" type="textarea">' + validator.escape(customCSS) + '</textarea><p class="help-block">Requires a refresh to take effect.</p>'
4034
});
35+
36+
callback(null, data);
4137
};
4238

4339
plugin.saveUserSettings = function(data) {

0 commit comments

Comments
 (0)