Skip to content

Commit 5914b1c

Browse files
author
mreishman
committed
button selection for watchlist groups added highlight on selected
1 parent fb073f8 commit 5914b1c

File tree

4 files changed

+26
-1
lines changed

4 files changed

+26
-1
lines changed

core/js/watchlist.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,13 @@ function checkWebsiteStatus(sendUrlHere)
253253
function toggleSettingsGroupSection(number, type)
254254
{
255255
$("#"+number+"General").hide();
256+
$("#"+number+"GeneralButton").removeClass("selected");
256257
$("#"+number+"Git").hide();
258+
$("#"+number+"GitButton").removeClass("selected");
257259
$("#"+number+"Advanced").hide();
260+
$("#"+number+"AdvancedButton").removeClass("selected");
258261
$("#"+number+type).show();
262+
$("#"+number+type+"Button").addClass("selected");
259263
}
260264

261265
$( document ).ready(function() {

core/php/functions/watchlistFunctions.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,16 @@ function generateWatchlistBlock($defaultArray, $arrayKeys, $key = "{{key}}", $it
2121
$stringToReturn .= "<div style=\"border-bottom: 1px solid black; margin-bottom: 5px; padding: 5px;\">";
2222
if(count($defaultArray) > 1)
2323
{
24+
$selectedOption = false;
2425
foreach($defaultArray as $groupName => $groupData)
2526
{
26-
$stringToReturn .= "<span class=\"buttonButton\" style=\"margin-right: 5px;\" onclick=\"toggleSettingsGroupSection('".$i."','".$groupName."');\" >".$groupName."</span>";
27+
$stringToReturn .= "<span id=\"".$i.$groupName."Button\" class=\"buttonButton ";
28+
if(!$selectedOption)
29+
{
30+
$stringToReturn .= " selected ";
31+
$selectedOption = true;
32+
}
33+
$stringToReturn .= " \" style=\"margin-right: 5px;\" onclick=\"toggleSettingsGroupSection('".$i."','".$groupName."');\" >".$groupName."</span>";
2734
}
2835
}
2936
else

core/template/theme.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,13 @@ input {
502502
border: 1px solid #999;
503503
}
504504

505+
.buttonButton.selected {
506+
background-color: #555;
507+
color: white;
508+
border: 1px solid #777;
509+
cursor: default;
510+
}
511+
505512
.noticeMessage{
506513
background-color: white;
507514
width: 100%;

local/default/template/theme.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,13 @@ input {
502502
border: 1px solid #999;
503503
}
504504

505+
.buttonButton.selected {
506+
background-color: #555;
507+
color: white;
508+
border: 1px solid #777;
509+
cursor: default;
510+
}
511+
505512
.noticeMessage{
506513
background-color: white;
507514
width: 100%;

0 commit comments

Comments
 (0)