mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-31 04:32:06 +08:00
Fix escaping for dropdown options and keywords escaping [SCI-8137] (#5145)
This commit is contained in:
parent
00c63b280e
commit
44823da268
2 changed files with 15 additions and 15 deletions
|
@ -541,16 +541,22 @@ var dropdownSelector = (function() {
|
|||
var customLabel = selector2.data('config').optionLabel;
|
||||
var customClass = params.optionClass || selector2.data('config').optionClass || '';
|
||||
var customStyle = selector2.data('config').optionStyle;
|
||||
return $(`
|
||||
<div class="dropdown-option ${customClass}" style="${customStyle ? customStyle(option) : ''}"
|
||||
title="${(option.params && option.params.tooltip) || ''}"
|
||||
data-params='${JSON.stringify(option.params || {})}'
|
||||
data-label="${option.label}"
|
||||
data-group="${group ? group.value : ''}"
|
||||
data-value="${option.value}">
|
||||
${customLabel ? customLabel(option) : option.label}
|
||||
</div>"
|
||||
var optionElement = $(`
|
||||
<div class="dropdown-option ${customClass}" style="${customStyle ? customStyle(option) : ''}">
|
||||
</div>
|
||||
`);
|
||||
optionElement
|
||||
.attr('title', (option.params && option.params.tooltip) || '')
|
||||
.attr('data-params', JSON.stringify(option.params || {}))
|
||||
.attr('data-label', option.label)
|
||||
.attr('data-group', group ? group.value : '')
|
||||
.attr('data-value', option.value);
|
||||
if (customLabel) {
|
||||
optionElement.html(customLabel(option));
|
||||
} else {
|
||||
optionElement.html(option.label);
|
||||
}
|
||||
return optionElement;
|
||||
}
|
||||
|
||||
// Draw delimiter object
|
||||
|
|
|
@ -172,12 +172,6 @@ class ProtocolsController < ApplicationController
|
|||
|
||||
def update_keywords
|
||||
respond_to do |format|
|
||||
# sanitize user input
|
||||
if params[:keywords]
|
||||
params[:keywords].collect! do |keyword|
|
||||
escape_input(keyword)
|
||||
end
|
||||
end
|
||||
if @protocol.update_keywords(params[:keywords])
|
||||
format.json do
|
||||
log_activity(:edit_keywords_in_protocol_repository, nil, protocol: @protocol.id)
|
||||
|
|
Loading…
Reference in a new issue