Fix bug.
This commit is contained in:
1 parent
6b0815e851
commit
c756faf89f
15 files changed
+289
-272
No files matched your search
@@ -96,7 +96,7 @@ function inputAppendLength() {
|
||||
|
||||
// Role Attribute Template Data
|
||||
function setData(l, type, ol) {
|
||||
var fields = $('#info').length ? "info[seminar_submission_fields]" : $('#sub_seminar_main').length ? "sub_seminar_main[seminar_submission_fields]" : "seminar_main[seminar_submission_fields]",
|
||||
var fields = $('#sub_seminar_main').length ? "sub_seminar_main[seminar_submission_fields_attributes]" : "seminar_main[seminar_submission_fields_attributes]",
|
||||
data = {
|
||||
_add_more: ["add_more_" +l, fields+"["+l+"]["+type+"][add_more]"],
|
||||
_calendar: ["calendar_" +l, fields+"["+l+"]["+type+"][calendar]"],
|
||||
@@ -110,7 +110,7 @@ function setData(l, type, ol) {
|
||||
_option_list: ["option_list_"+l+"_"+ol, fields+"["+l+"]["+type+"][option_list]["+ol+"]", "option_list_"+ol],
|
||||
_placeholder: ["placeholder_" +l, fields+"["+l+"]["+type+"][placeholder]"],
|
||||
_title_translations: ["title_translations_" +l, fields+"["+l+"][title_translations]"],
|
||||
_to_delete: ["to_delete_" +l, fields+"["+l+"][to_delete]"],
|
||||
_destroy: ["destroy_" +l, fields+"["+l+"][_destroy]"],
|
||||
_to_require: ["to_require_" +l, fields+"["+l+"][to_require]"],
|
||||
};
|
||||
return data;
|
||||
@@ -270,6 +270,7 @@ $(function() {
|
||||
attributesArray = [];
|
||||
attributesHeaderLength = null;
|
||||
templateType = null;
|
||||
var default_templateType = 'typeA';
|
||||
attributeIndex = null;
|
||||
if($('.add-target').length) {
|
||||
inputAppendLength();
|
||||
@@ -286,7 +287,7 @@ $(function() {
|
||||
};
|
||||
attributesHeaderLength = $('.attributes:not(:hidden)').length+1;
|
||||
attributesLength = $('#attributes-area .attributes').length;
|
||||
$("#template-attributes").tmpl(setData(attributesLength, templateType, appendIndex)).appendTo( "#attributes-area" );
|
||||
$("#template-attributes").tmpl(setData(attributesLength, default_templateType, appendIndex)).appendTo( "#attributes-area" );
|
||||
$('.toggle-check').togglebox();
|
||||
});
|
||||
|
||||
@@ -426,7 +427,7 @@ $(function() {
|
||||
if(!$('.attributes:not(:hidden)').length) {
|
||||
$('#attributes-area').addClass('clickHere');
|
||||
};
|
||||
}).find('.attribute_field_to_delete').attr('value', 'true');;
|
||||
}).find('.attribute_field_destroy').attr('value', 'true');;
|
||||
};
|
||||
if($(this).hasClass('trigger')) {
|
||||
// appendIndex = $(this).closest('.controls').find('.input-append').length;
|
||||
|
||||
@@ -96,7 +96,7 @@ function inputAppendLength() {
|
||||
|
||||
// Role Attribute Template Data
|
||||
function setData(l, type, ol) {
|
||||
var fields = $('#info').length ? "info[seminar_signup_fields]" : $('#sub_seminar_main').length ? "sub_seminar_main[seminar_signup_fields]" : "seminar_main[seminar_signup_fields]",
|
||||
var fields = $('#sub_seminar_main').length ? "sub_seminar_main[seminar_signup_fields_attributes]" : "seminar_main[seminar_signup_fields_attributes]",
|
||||
data = {
|
||||
_add_more: ["add_more_" +l, fields+"["+l+"]["+type+"][add_more]"],
|
||||
_calendar: ["calendar_" +l, fields+"["+l+"]["+type+"][calendar]"],
|
||||
@@ -110,7 +110,7 @@ function setData(l, type, ol) {
|
||||
_option_list: ["option_list_"+l+"_"+ol, fields+"["+l+"]["+type+"][option_list]["+ol+"]", "option_list_"+ol],
|
||||
_placeholder: ["placeholder_" +l, fields+"["+l+"]["+type+"][placeholder]"],
|
||||
_title_translations: ["title_translations_" +l, fields+"["+l+"][title_translations]"],
|
||||
_to_delete: ["to_delete_" +l, fields+"["+l+"][to_delete]"],
|
||||
_destroy: ["destroy_" +l, fields+"["+l+"][_destroy]"],
|
||||
_to_require: ["to_require_" +l, fields+"["+l+"][to_require]"],
|
||||
};
|
||||
return data;
|
||||
@@ -270,6 +270,7 @@ $(function() {
|
||||
attributesArray = [];
|
||||
attributesHeaderLength = null;
|
||||
templateType = null;
|
||||
var default_templateType = 'typeA';
|
||||
attributeIndex = null;
|
||||
if($('.add-target').length) {
|
||||
inputAppendLength();
|
||||
@@ -286,10 +287,7 @@ $(function() {
|
||||
};
|
||||
attributesHeaderLength = $('.attributes:not(:hidden)').length+1;
|
||||
attributesLength = $('#attributes-area .attributes').length;
|
||||
if(templateType == null){
|
||||
templateType = "typeA";
|
||||
}
|
||||
$("#template-attributes").tmpl(setData(attributesLength, templateType, appendIndex)).appendTo( "#attributes-area" );
|
||||
$("#template-attributes").tmpl(setData(attributesLength, default_templateType, appendIndex)).appendTo( "#attributes-area" );
|
||||
$('.toggle-check').togglebox();
|
||||
});
|
||||
|
||||
@@ -429,7 +427,7 @@ $(function() {
|
||||
if(!$('.attributes:not(:hidden)').length) {
|
||||
$('#attributes-area').addClass('clickHere');
|
||||
};
|
||||
}).find('.attribute_field_to_delete').attr('value', 'true');;
|
||||
}).find('.attribute_field_destroy').attr('value', 'true');;
|
||||
};
|
||||
if($(this).hasClass('trigger')) {
|
||||
// appendIndex = $(this).closest('.controls').find('.input-append').length;
|
||||
|
||||
Reference in new issue
Block a user