Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mahara
mahara
Commits
c755c144
Commit
c755c144
authored
Oct 25, 2016
by
Robert Lyon
Committed by
Gerrit Code Review
Oct 25, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Bug 1606744: Correcting linking 'other' label for pieform select" into 15.04_STABLE
parents
c124af49
586dcf1a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
13 deletions
+14
-13
htdocs/lib/pieforms/pieform/elements/select.php
htdocs/lib/pieforms/pieform/elements/select.php
+13
-12
test/behat/features/account/edit_admin_profile.feature
test/behat/features/account/edit_admin_profile.feature
+1
-1
No files found.
htdocs/lib/pieforms/pieform/elements/select.php
View file @
c755c144
...
...
@@ -154,7 +154,7 @@ function pieform_element_select(Pieform $form, $element) {
$other_attrib
[
'class'
]
=
'hidden'
;
$other_value
=
''
;
}
$result
.
=
'<label for="'
.
$
element
[
'id'
]
.
'_other
" class="accessible-hidden">'
.
get_string
(
'licenseotherurl'
)
.
'</label>'
$result
.
=
'<label for="'
.
$
form
->
make_id
(
$other_attrib
,
true
)
.
'
" class="accessible-hidden">'
.
get_string
(
'licenseotherurl'
)
.
'</label>'
.
'<input type="text"'
.
$form
->
element_attributes
(
$other_attrib
)
.
$other_value
...
...
@@ -302,17 +302,18 @@ function pieform_element_select_get_options($element) {
}
function
pieform_element_select_get_inlinejs
()
{
$result
=
'function pieform_select_other(el) {//{{{'
.
"
\n
"
;
$result
.
=
' var $el = $(el),'
.
"
\n
"
;
$result
.
=
' $$other = jQuery(\'#\' + $el.id + \'_other\');'
.
"
\n
"
;
$result
.
=
' if ($el.value == \'other\') {'
.
"
\n
"
;
$result
.
=
' $$other.show();'
.
"
\n
"
;
$result
.
=
' }'
.
"
\n
"
;
$result
.
=
' else {'
.
"
\n
"
;
$result
.
=
' $$other.hide();'
.
"
\n
"
;
$result
.
=
' }'
.
"
\n
"
;
$result
.
=
'}//}}}'
.
"
\n
"
;
return
$result
;
return
<<<EOF
function pieform_select_other(el) {
var element = $(el);
var other = jQuery('#' + element.id + '_other');
if (element.value == 'other') {
other.removeClass('hidden');
}
else {
other.addClass('hidden');
}
}
EOF;
}
function
pieform_element_select_get_headdata
()
{
...
...
test/behat/features/account/edit_admin_profile.feature
View file @
c755c144
...
...
@@ -36,7 +36,7 @@ Scenario: Editing admin profile page (Bug: 1426983)
And
I follow
"Social media"
And
I follow
"New social media account"
And I fill in the following
:
|
editprofileform_profiletype_other
|
http://github.com/MaharaProject
|
|
Enter
URL
|
http://github.com/MaharaProject
|
|
Your
URL
or
username
|
https://twitter.com/MaharaProject
|
And
I press
"Save"
# Verifying the settings held, navitgating to dashboard page to check
...
...
Write
Preview
Markdown
is supported
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