Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
ac8ad8fc
Commit
ac8ad8fc
authored
Jan 19, 2017
by
Robert Lyon
Committed by
Gerrit Code Review
Jan 19, 2017
Browse files
Merge "Bug 1645455: Fix html shown in autocomplete searchbox"
parents
4c99af9c
1e3a0061
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/theme/raw/templates/form/autocomplete.tpl
View file @
ac8ad8fc
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
<script
type=
"application/javascript"
>
<script
type=
"application/javascript"
>
{
{
if
!
$inblockconfig
}
}
{
{
if
!
$inblockconfig
}
}
jQuery
(
window
).
load
(
function
()
{
jQuery
(
window
).
on
(
'
load
'
,
function
()
{
{
{/
if
}
}
{
{/
if
}
}
jQuery
(
"
#{
{
$id
}
}
"
).
select2
({
jQuery
(
"
#{
{
$id
}
}
"
).
select2
({
ajax
:
{
ajax
:
{
...
@@ -27,7 +27,15 @@
...
@@ -27,7 +27,15 @@
},
},
processResults
:
function
(
data
,
page
)
{
processResults
:
function
(
data
,
page
)
{
return
{
return
{
results
:
data
.
results
,
results
:
jQuery
.
map
(
data
.
results
,
function
(
item
)
{
// sometimes text contains html that has to be renderered in the result list (e.g. user profile)
// we're assigning text to resultsText variable that get rendered in results, and
// leave only text values in text variable. (in selection field will be displayed only text without markup)
return
jQuery
.
extend
(
item
,
{
resultsText
:
item
.
text
,
text
:
jQuery
(
'
<div>
'
).
html
(
item
.
text
).
text
()
})
}),
pagination
:
{
pagination
:
{
more
:
data
.
more
more
:
data
.
more
}
}
...
@@ -40,6 +48,9 @@
...
@@ -40,6 +48,9 @@
allowClear
:
{
{
$allowclear
}
},
allowClear
:
{
{
$allowclear
}
},
{
{
if
$hint
}
}
placeholder
:
"
{
{
$hint
}
}
"
,{
{/
if
}
}
{
{
if
$hint
}
}
placeholder
:
"
{
{
$hint
}
}
"
,{
{/
if
}
}
minimumInputLength
:
{
{
$mininputlength
}
},
minimumInputLength
:
{
{
$mininputlength
}
},
templateResult
:
function
(
item
)
{
return
item
.
resultsText
||
item
.
text
;
},
{
{
$extraparams
|
safe
}
}
{
{
$extraparams
|
safe
}
}
});
});
{
{
if
!
$inblockconfig
}
}
{
{
if
!
$inblockconfig
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment