Commit dd7d2574 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review

Merge "Bug 1606744: Correcting linking 'other' label for pieform select" into 15.10_STABLE

parents bc472fd6 9d845b54
......@@ -157,7 +157,7 @@ function pieform_element_select(Pieform $form, $element) {
$other_attrib['class'] = 'hidden';
$other_value = '';
}
$result .= '<label for="' . $element['id'] . '_other" class="accessible-hidden sr-only">' . get_string('licenseotherurl') . '</label>'
$result .= '<label for="' . $form->make_id($other_attrib, true) . '" class="accessible-hidden sr-only">' . get_string('licenseotherurl') . '</label>'
. '<input type="text"'
. $form->element_attributes($other_attrib)
. $other_value
......@@ -311,17 +311,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() {
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment