Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 157f3db

Browse files
adding asterisk when there are new results
1 parent 1fc99cd commit 157f3db

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

‎static/adj.js‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @returns false
77
*/
88
var changeTab = function(e, level = "") {
9-
var eid = $(e.target).parent().attr("id").split("_")[0];
9+
var label = $(e.target).parent().attr("id").split("_")[0];
1010

1111
// TODO: Add error checking
1212

@@ -21,8 +21,15 @@ var changeTab = function(e, level = "") {
2121
});
2222

2323
// Show the current tab, and add an "active" class to the button that opened the tab
24-
$('#' + eid + "_button").addClass("active");
25-
$('#' + eid + "_block").show();
24+
$('#' + label + "_button").addClass("active");
25+
$('#' + label + "_block").show();
26+
27+
// if this has a *, remove
28+
var button_text = $('#' + label + '_button-link').text();
29+
if (button_text.indexOf("*") > -1) {
30+
button_text = button_text.replace("*", "");
31+
$('#' + label + '_button-link').html(button_text);
32+
}
2633

2734
return false;
2835
}
@@ -583,6 +590,9 @@ $(function () {
583590
n_results = req.getResponseHeader('Search-Results');
584591
$('#cand-search-text').text("Search (" + n_results + " results)");
585592

593+
// Update the candidate button text.
594+
$('#cand_button-link').text("Candidate Events*");
595+
586596
// Update the URL search params.
587597
let curr_search_params = new URLSearchParams(window.location.search);
588598
var search_params = jQuery.parseJSON(req.getResponseHeader('Query'));
@@ -593,6 +603,8 @@ $(function () {
593603
var new_url = 'adj?' + curr_search_params.toString();
594604
window.history.pushState({path: new_url}, '', new_url);
595605

606+
initializeSearchListeners();
607+
596608
// get rid of loading flash
597609
$('.flash').hide();
598610
$('.flash').removeClass('alert-info');

‎templates/adj.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ <h4>Event Selection</h4>
2929
<a href="#">Search</a>
3030
</li>
3131
<li class="tablinks" id="cand_button">
32-
<a href="#">Candidate Events</a>
32+
<a href="#"id="cand_button-link">Candidate Events</a>
3333
</li>
3434
<li class="tablinks" id="canon_button">
3535
<a href="#">Canonical Events</a>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /