Fixed the display of the widget

This commit is contained in:
Alexandr Antonov 2023-02-17 12:19:36 +03:00
parent 34cac73052
commit 5d724a03be

View File

@ -161,7 +161,8 @@ var RedmineHelpdeskWidget = {
if (this.identify('subjectValue') == 'Custom' ) {
var str = this.identify('customTextValue');
var res = str.split(",");
this.create_form_select_subject(this.form, 'subject', 'issue[subject]', res, project_id, 'form-control');
this.create_form_title_subject();
this.create_form_select_subject(this.form, 'subject', 'issue[subject]', res, project_id, 'form-control required-field');
}
if (this.identify('issueCategory')) {
this.create_form_hidden(this.form, 'issue_category', 'issue_category', 'form-control', this.identify('issueCategory'));
@ -270,6 +271,12 @@ var RedmineHelpdeskWidget = {
this.form.appendChild(title_div);
}
},
create_form_title_subject: function(){
subject_span = document.createElement('label');
subject_span.innerHTML = 'Тема обращения *';
subject_span.style = 'color: #333;padding-bottom: 3px;font-size: 12px;';
this.form.appendChild(subject_span);
},
create_error_flash: function(){
flash_div = document.createElement('div');
flash_div.id = 'flash';
@ -387,9 +394,10 @@ var RedmineHelpdeskWidget = {
field.className = field_class;
for (var project in values) {
option = document.createElement('option');
option.value = values[project]
option.value = values[project];
if(values[project] == selected) { option.selected = 'selected'; }
option.innerHTML = values[project];
if(values[project] == '') { option.innerHTML = '--- Выберите ---'; }
field.appendChild(option);
}
}