Skip to content

Commit

Permalink
Add repo title when search box is hidden
Browse files Browse the repository at this point in the history
As suggested by @tooomm (#17 (comment))
  • Loading branch information
PhrozenByte committed Nov 16, 2017
1 parent 1b34134 commit 19f2bf2
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
16 changes: 16 additions & 0 deletions css/main.css
Expand Up @@ -109,6 +109,22 @@ code {
text-align: center;
}

#title {
display: none;
margin: 20px 0 10px 0;
text-align: center;
}

#title > h1 {
display: inline;
margin-right: 10px;
font-weight: bold;
}

#title > span {
font-size: 24px;
}

html {
position: relative;
min-height: 100%;
Expand Down
4 changes: 4 additions & 0 deletions index.html
Expand Up @@ -55,6 +55,10 @@ <h1>Enter project details...</h1>
<div class="row" id="description">
<h1>...and get the latest release stats like download counts, release dates, authors for any Github project.</h1>
</div>
<div class="row" id="title">
<h1><span class="username"></span>/<span class="repository"></span></h1>
<span class="description">release stats</span>
</div>
<div class="row" id="ads">
<div class="col-md-6 col-md-offset-2">
<script type="text/javascript">
Expand Down
15 changes: 10 additions & 5 deletions js/main.js
Expand Up @@ -183,7 +183,8 @@ $(function() {

$("#get-stats-button").click(function() {
window.location = "?username=" + $("#username").val() +
"&repository=" + $("#repository").val();
"&repository=" + $("#repository").val() +
((getQueryVariable("search") == "0") ? "&search=0" : "");
});

var username = getQueryVariable("username");
Expand All @@ -192,16 +193,20 @@ $(function() {

if(username != "" && repository != "") {
$("#username").val(username);
$("#title .username").text(username);
$("#repository").val(repository);
$("#title .repository").text(repository);
validateInput();
getUserRepos();
$(".output").hide();
$("#description").hide();
$("#loader-gif").show();
getStats();
}
if(showSearch == "0") {
$("#search").hide();
$("#description").hide();

if(showSearch == "0") {
$("#search").hide();
$("#description").hide();
$("#title").show();
}
}
});

0 comments on commit 19f2bf2

Please sign in to comment.