Commit de1ac1b6 authored by Naruedom khunrong's avatar Naruedom khunrong

Merge branch 'DRAFT' into 'master'

Draft

See merge request !8
parents 555664ab b051a9e8
......@@ -39,7 +39,7 @@
</footer><!-- #colophon -->
</div><!-- #page -->
<div class="position-fixed px-3 py-2 gotoTop rounded"><span class="dashicons dashicons-arrow-up-alt2"></span></div>
<div class="position-fixed px-2 py-1 gotoTop rounded"><span class="dashicons dashicons-arrow-up-alt2"></span></div>
<?php wp_footer(); ?>
</body>
......
......@@ -97,12 +97,10 @@ h6 {
vertical-align: bottom;
}
.gotoTop{
background: #000;
bottom: 0px;
left: 50%;
margin-left: -32px;
display: none;
margin-bottom: -4px;
background: #000;
bottom: 10px;
right: 10px;
cursor: pointer;
z-index: 99999;
}
......
......@@ -27,27 +27,35 @@ get_header(); ?>
<div class="row">
<div class="col">
<?php // the_archive_title();
single_tag_title( '<h2 class="iwrite-category-title mt-2 mt-md-0">', '</h2>' );
single_tag_title( '<h2 class="iwrite-category-title text-uppercase mt-2 mt-md-0">', '</h2>' );
?>
</div>
<div class="col-md-4">
<div class="form-group">
<input class="form-control" list="issues" name="issue" placeholder="issue" oninput="checkIssue(this.value)">
<div class="text-center" style="display:none;" id="issue-loading">
<div class="spinner-border text-info" role="status">
<span class="sr-only">Loading...</span>
</div>
</div>
<div class="form-group" id="issue-input">
<input class="form-control form-control-sm" list="issues" name="issue" placeholder="issue" oninput="checkIssue(this.value)">
<datalist id="issues">
<?php
$tags = get_tags(['order' => DESC]);
foreach ( $tags as $tag ) :
?>
<option value="<?php echo $tag->slug; ?>" onclick="alert('click')"><?php echo $tag->count; ?></option>
<option data-value="<?php echo $tag->slug; ?>" value="<?php echo $tag->name ?>" onclick="alert('click')"><?php echo $tag->count; ?> </option>
<?php
endforeach
?>
</datalist>
</div>
</div>
</div>
<?php
the_archive_description( '<p class="taxonomy-description">sadfsdaf', '</p>' );
the_archive_description( '<p class="taxonomy-description">', '</p>' );
?>
</div>
</div>
......@@ -82,10 +90,20 @@ get_header(); ?>
var issues = tags.map(tag => tag.slug);
function checkIssue(value){
if(issues.includes(value)) {
window.location.replace( '<?php echo get_site_url(); ?>/tag/'+value );
}
try {
var value2send = document.querySelector("#issues option[value='"+value+"']").dataset.value;
if(issues.includes(value2send)) {
window.location.replace( '<?php echo get_site_url(); ?>/tag/'+value2send );
document.getElementById("issue-input").style.display = "none";
document.getElementById("issue-loading").style.display = "block";
}
} catch (error) { }
}
</script>
<?php get_footer(); ?>
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