diff options
author | Mario Vavti <mario@mariovavti.com> | 2017-03-02 12:51:31 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2017-03-02 12:51:31 +0100 |
commit | 6bf6462a377d1a80ab30d63b48034fb4cde0bb9e (patch) | |
tree | d9f404453b4bc773a6e24573b9fa2c318dae30a5 /view/js/mod_settings.js | |
parent | dd8a3d845e274231bc53326f32685ec2431af2fa (diff) | |
download | volse-hubzilla-6bf6462a377d1a80ab30d63b48034fb4cde0bb9e.tar.gz volse-hubzilla-6bf6462a377d1a80ab30d63b48034fb4cde0bb9e.tar.bz2 volse-hubzilla-6bf6462a377d1a80ab30d63b48034fb4cde0bb9e.zip |
provide info if there are no sche,es available
Diffstat (limited to 'view/js/mod_settings.js')
-rw-r--r-- | view/js/mod_settings.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/view/js/mod_settings.js b/view/js/mod_settings.js index cb0b44ff2..f9faa3d5c 100644 --- a/view/js/mod_settings.js +++ b/view/js/mod_settings.js @@ -41,10 +41,15 @@ function previewTheme(elm) { $.getJSON('theme_info/' + theme,function(data) { $('#theme-preview').html('<div id="theme-desc">' + data.desc + '</div><div id="theme-version">' + data.version + '</div><div id="theme-credits">' + data.credits + '</div><a href="' + data.img + '"><img src="' + data.img + '" style="max-width:100%; max-height:300px" alt="' + theme + '"></a>'); $('#id_schema').empty(); - $(data.schemas).each(function(index,item) { - $('<option/>',{value:item['key'],text:item['val']}).appendTo('#id_schema'); - }); - $('#id_schema').val(schema ? schema : '---'); + if(data.schemas.length) { + $(data.schemas).each(function(index,item) { + $('<option/>',{value:item['key'],text:item['val']}).appendTo('#id_schema'); + }); + $('#id_schema').val(schema ? schema : '---'); + } + else { + $('<option/>',{value:'',text:'No schemes available'}).appendTo('#id_schema'); + } $('#custom-settings-content .section-content-tools-wrapper').html(data.config); }); } |