Commit 41eff50c authored by Robert Lyon's avatar Robert Lyon Committed by Cecilia Vela Gurovic

Bug 1822694: Correctly show the 'match all tags' option

When in the pages index page for
- users
- groups
- institutions
- site

behatnotneeded

Change-Id: I368fad84abfa3fe293144ea16ba13ef757e6b6e9
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 16e84a5a
......@@ -37,6 +37,7 @@ else {
$js = <<< EOF
jQuery(function() {
{$pagination['javascript']}
showmatchall();
EOF;
if ($offset > 0) {
$js .= <<< EOF
......
......@@ -1164,3 +1164,17 @@ function pmeter_presubmit(form, btn) {
formStartProcessing(form, btn);
}
function showmatchall() {
if ($('#searchviews_type').val() == 'tagsonly') {
$('#searchviews_matchalltags_container').parent().find('.d-none').removeClass('d-none'); // because the d-none from form is on container and input
}
else {
$('#searchviews_matchalltags_container').addClass('d-none');
}
}
$(function() {
$('#searchviews_type').on('change', function() {
showmatchall();
});
});
......@@ -4436,7 +4436,7 @@ class View {
),
'matchalltags' => array (
'type' => 'checkbox',
'class' => 'matchalltags',
'class' => 'matchalltags d-none',
'title' => get_string('matchalltags', 'view'),
'defaultvalue' => $matchalltags,
'description' => get_string('matchalltagsdesc', 'view'),
......
......@@ -94,6 +94,7 @@ else {
$js = <<< EOF
jQuery(function ($) {
{$pagination['javascript']}
showmatchall();
EOF;
if ($offset > 0) {
$js .= <<< EOF
......
......@@ -27,17 +27,6 @@ list($searchform, $data, $pagination) = View::views_by_owner();
$js = <<< EOF
jQuery(function ($) {
{$pagination['javascript']}
function showmatchall() {
if ($('#searchviews_type').val() == 'tagsonly') {
$('#searchviews_matchalltags_container').show();
}
else {
$('#searchviews_matchalltags_container').hide();
}
}
$('#searchviews_type').on('change', function() {
showmatchall();
});
showmatchall();
EOF;
if ($offset > 0) {
......
......@@ -47,6 +47,7 @@ list($searchform, $data, $pagination) = View::views_by_owner(null, $institution)
$js = <<< EOF
jQuery(function () {
{$pagination['javascript']}
showmatchall();
EOF;
if ($offset > 0) {
$js .= <<< EOF
......
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