Commit 53e21f85b4332a2736011634bd31f8fdd4459cdf
1 parent
5a911ba4
Exists in
master
and in
28 other branches
Fixed html escape on suborganization plugin
(ActionItem2699)
Showing
1 changed file
with
6 additions
and
10 deletions
Show diff stats
app/helpers/application_helper.rb
... | ... | @@ -1346,10 +1346,7 @@ module ApplicationHelper |
1346 | 1346 | options[:on_ready] ||= 'null' |
1347 | 1347 | |
1348 | 1348 | result = text_field_tag(name, nil, text_field_options.merge(html_options.merge({:id => element_id}))) |
1349 | - result += | |
1350 | - " | |
1351 | - <script type='text/javascript'> | |
1352 | - jQuery('##{element_id}') | |
1349 | + result += javascript_tag("jQuery('##{element_id}') | |
1353 | 1350 | .tokenInput('#{url_for(search_action)}', { |
1354 | 1351 | minChars: #{options[:min_chars].to_json}, |
1355 | 1352 | prePopulate: #{options[:pre_populate].to_json}, |
... | ... | @@ -1365,16 +1362,15 @@ module ApplicationHelper |
1365 | 1362 | onAdd: #{options[:on_add]}, |
1366 | 1363 | onDelete: #{options[:on_delete]}, |
1367 | 1364 | onReady: #{options[:on_ready]}, |
1368 | - }) | |
1369 | - " | |
1370 | - result += options[:focus] ? ".focus();" : ";" | |
1365 | + }); | |
1366 | + ") | |
1367 | + result += javascript_tag("jQuery('##{element_id}').focus();") if options[:focus] | |
1371 | 1368 | if options[:avoid_enter] |
1372 | - result += "jQuery('#token-input-#{element_id}') | |
1369 | + result += javascript_tag("jQuery('#token-input-#{element_id}') | |
1373 | 1370 | .live('keydown', function(event){ |
1374 | 1371 | if(event.keyCode == '13') return false; |
1375 | - });" | |
1372 | + });") | |
1376 | 1373 | end |
1377 | - result += "</script>" | |
1378 | 1374 | result |
1379 | 1375 | end |
1380 | 1376 | ... | ... |