Commit c755c144 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

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

parents c124af49 586dcf1a
...@@ -154,7 +154,7 @@ function pieform_element_select(Pieform $form, $element) { ...@@ -154,7 +154,7 @@ function pieform_element_select(Pieform $form, $element) {
$other_attrib['class'] = 'hidden'; $other_attrib['class'] = 'hidden';
$other_value = ''; $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"' . '<input type="text"'
. $form->element_attributes($other_attrib) . $form->element_attributes($other_attrib)
. $other_value . $other_value
...@@ -302,17 +302,18 @@ function pieform_element_select_get_options($element) { ...@@ -302,17 +302,18 @@ function pieform_element_select_get_options($element) {
} }
function pieform_element_select_get_inlinejs() { function pieform_element_select_get_inlinejs() {
$result = 'function pieform_select_other(el) {//{{{' . "\n"; return <<<EOF
$result .= ' var $el = $(el),' . "\n"; function pieform_select_other(el) {
$result .= ' $$other = jQuery(\'#\' + $el.id + \'_other\');' . "\n"; var element = $(el);
$result .= ' if ($el.value == \'other\') {' . "\n"; var other = jQuery('#' + element.id + '_other');
$result .= ' $$other.show();' . "\n"; if (element.value == 'other') {
$result .= ' }' . "\n"; other.removeClass('hidden');
$result .= ' else {' . "\n"; }
$result .= ' $$other.hide();' . "\n"; else {
$result .= ' }' . "\n"; other.addClass('hidden');
$result .= '}//}}}' . "\n"; }
return $result; }
EOF;
} }
function pieform_element_select_get_headdata() { function pieform_element_select_get_headdata() {
......
...@@ -36,7 +36,7 @@ Scenario: Editing admin profile page (Bug: 1426983) ...@@ -36,7 +36,7 @@ Scenario: Editing admin profile page (Bug: 1426983)
And I follow "Social media" And I follow "Social media"
And I follow "New social media account" And I follow "New social media account"
And I fill in the following: 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 | | Your URL or username | https://twitter.com/MaharaProject |
And I press "Save" And I press "Save"
# Verifying the settings held, navitgating to dashboard page to check # 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