Commit 209da6bd authored by Chenu Denis's avatar Chenu Denis
Browse files

[fix] 4.X : save survey theme options

parent d9d789d1
......@@ -14,14 +14,14 @@
<authorEmail>noreply@sondages.pro</authorEmail>
<authorUrl>https://www.sondages.pro/contact</authorUrl>
<supportUrl>https://extensions.sondages.pro/themes-and-templates/skelvanilla-a11y-and-usuability/</supportUrl>
<copyright>Copyright (C) 2018-2019 Denis Chenu / Sondages Pro</copyright>
<copyright>Copyright (C) 2018-2020 Denis Chenu / Sondages Pro</copyright>
<license>GNU General Public License version 3 or later</license>
<version>9.2.1</version>
<version>9.2.2</version>
<apiVersion>3</apiVersion>
<description><![CDATA[<strong>LimeSurvey Bootstrap Vanilla Survey Theme with Accessibility and Options</strong><br>Base on vanilla theme, usage of more aria, fix some role and aria from core.<br>Allow usage of a lot of variations, list of variation can be updated. Some decoration option using boostrap class.]]></description>
<extends>vanilla</extends>
<last_update>2020-06-26 16:53:58</last_update>
<lastUpdate>020-06-26 16:53:58</lastUpdate>
<last_update>2020-07-01 07:34:48</last_update>
<lastUpdate>2020-07-01 07:34:48</lastUpdate>
</metadata>
<files>
......
......@@ -147,7 +147,7 @@ var ThemeOptions = function(){
var prepareSelectField = function(){
globalForm.find('.selector_option_value_field').each(function(i,item){
var itemValue = parseOptionValue(item, 'off');
$(item).val(itemValue);
$(item).val(itemValue).trigger("change");
disableImagePreviewIfneeded(item);
});
};
......@@ -256,12 +256,11 @@ var ThemeOptions = function(){
// -- These methods are triggered on events. Please see `bind´ method for more information
var onSaveButtonClickAction = function(evt){
evt.preventDefault();
if(generalInherit()){
$('#TemplateConfiguration_options').val('inherit');
$('#TemplateConfiguration_cssframework_css').val('inherit');
$('#TemplateConfiguration_cssframework_js').val('inherit');
$('#template-options-form').find('button[type=submit]').trigger('click'); // submit the form
$('#template-options-form').trigger('submit'); // submit the form
} else {
//Create a copy of the inherent optionObject
var newOptionObject = $.extend(true, {}, optionObject);
......@@ -275,13 +274,13 @@ var ThemeOptions = function(){
var selectedCss = $("#simple_edit_options_theme").val();
if (selectedCss == "inherit") {
$('#TemplateConfiguration_cssframework_css').val('inherit');
return;
} else {
var cssFrameworkCss = {};
cssFrameworkCss.replace = [["css/bootstrap.css",$('#simple_edit_cssframework').val()]];
$('#TemplateConfiguration_cssframework_css').val(JSON.stringify(cssFrameworkCss));
}
var cssFrameworkCss = {};
cssFrameworkCss.replace = [["css/bootstrap.css",$('#simple_edit_cssframework').val()]];
$('#TemplateConfiguration_cssframework_css').val(JSON.stringify(cssFrameworkCss));
//and submit the form
$('#template-options-form').find('button[type=submit]').trigger('click');
$('#template-options-form').trigger('submit');
}
};
......@@ -290,7 +289,7 @@ var ThemeOptions = function(){
// Instance methods
var bind = function(){
//if the save button is clicked write everything into the template option field and send the form
$('.action_update_options_string_button').on('click', onSaveButtonClickAction);
$('.action_update_options_string_button, #theme-options--submit').on('click', onSaveButtonClickAction);
//Bind the hotwaps
hotSwapParentRadioButtons();
......
......@@ -48,16 +48,13 @@
{% endif %}
{# If this is a surveyspecific settings page, offer the possibility to do a full inheritance of the parent template #}
{# CSS variation : fixed for parent, can be updated in child #}
{% if templateConfiguration.sid is empty %}
{% set sAvailableVariations = templateConfiguration.availablevariations %}
{% endif %}
{% if templateConfiguration.availablevariations is null %}
{% if oParentOptions.availablevariations is null %}
{% set sAvailableVariations = '{"contrast":{"name":"Contrast","base":"true","button":"true","awesome":"true","button_awesome":"true"},"bootstrap":{"name":"Bootstrap","base":"true","button":"true","awesome":"true","button_awesome":"true"},"cerulean":{"name":"Cerulean","base":"true","button":"true","awesome":"true","button_awesome":"true"},"cosmo":{"name":"Cosmo","base":"true","button":"true","awesome":"true","button_awesome":"true"},"cyborg":{"name":"Cyborg","base":"true","button":"true","awesome":"true","button_awesome":"true"},"darkly":{"name":"Darkly","base":"true","button":"true","awesome":"true","button_awesome":"true"},"flatly":{"name":"Flatly","base":"true","button":"true","awesome":"true","button_awesome":"true"},"journal":{"name":"Journal","base":"true","button":"true","awesome":"true","button_awesome":"true"},"lumen":{"name":"Lumen","base":"true","button":"true","awesome":"true","button_awesome":"true"},"paper":{"name":"Paper","base":"true","button":"true","awesome":"true","button_awesome":"true"},"readable":{"name":"Readable","base":"true","button":"true","awesome":"true","button_awesome":"true"},"sandstone":{"name":"Sandstone","base":"true","button":"true","awesome":"true","button_awesome":"true"},"simplex":{"name":"Simplex","base":"true","button":"true","awesome":"true","button_awesome":"true"},"slate":{"name":"Slate","base":"true","button":"true","awesome":"true","button_awesome":"true"},"spacelab":{"name":"Spacelab","base":"true","button":"true","awesome":"true","button_awesome":"true"},"superhero":{"name":"Superhero","base":"true","button":"true","awesome":"true","button_awesome":"true"},"united":{"name":"United","base":"true","button":"true","awesome":"true","button_awesome":"true"},"yeti":{"name":"Yeti","base":"true","button":"true","awesome":"true","button_awesome":"true"}}' %}
{% else %}
{% set sAvailableVariations = oParentOptions.availablevariations %}
{% endif %}
{% set templateOptions = json_decode(templateConfiguration.options) %}
{% set sAvailableVariations = templateOptions.availablevariations %}
{% if templateConfiguration.sid %}
{# broken in 4 #}
{% set sAvailableVariations = oParentOptions.availablevariations %}
{% endif %}
{# Functionnal #}
<h3 class="h3 action_hide_on_inherit">{{ gT("Functionnal") }}</h3>
{# First settings row #}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment