mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Not showing card-reveal when list has no description
This commit is contained in:
@@ -25,7 +25,17 @@ var cors = require('cors');
|
||||
var hbs = exphbs.create({
|
||||
defaultLayout: publicPath + '/layouts/client/main',
|
||||
layoutsDir: publicPath + '/layouts/client',
|
||||
partialsDir: publicPath + '/partials'
|
||||
partialsDir: publicPath + '/partials',
|
||||
helpers: {
|
||||
if_equal: function(a, b, opts) {
|
||||
if (a == b) {
|
||||
return opts.fn(this)
|
||||
} else {
|
||||
return opts.inverse(this)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
var uniqid = require('uniqid');
|
||||
app.use(compression({filter: shouldCompress}))
|
||||
|
||||
@@ -110,12 +110,12 @@ var Frontpage = {
|
||||
card.querySelector(".chan-bg").setAttribute("style", img);
|
||||
card.querySelector(".chan-link").setAttribute("href", chan + "/");
|
||||
|
||||
if(description != "" && description != undefined && !Helper.mobilecheck()) {
|
||||
if(description != "" && description != undefined && !Helper.mobilecheck() && description != "This list has no description") {
|
||||
card.querySelector(".card-title").innerText = chan;
|
||||
card.querySelector(".description_text").innerText = description;
|
||||
description = "";
|
||||
} else {
|
||||
//card.querySelector(".card-reveal").remove();
|
||||
card.querySelector(".card-reveal").remove();
|
||||
Helper.removeClass(card.querySelector(".card"), "sticky-action")
|
||||
}
|
||||
|
||||
|
||||
@@ -775,6 +775,7 @@ document.addEventListener("click", function(event) {
|
||||
document.addEventListener("mouseleave", function(event) {
|
||||
if(event.target.className == "card sticky-action") {
|
||||
var that = event.target;
|
||||
if(that.querySelector(".card-reveal") == null) return;
|
||||
that.querySelector(".card-reveal").setAttribute("style", "display: block;transform: translateY(0%);");
|
||||
clearTimeout(image_timeout);
|
||||
image_timeout = setTimeout(function(){
|
||||
@@ -786,6 +787,7 @@ document.addEventListener("mouseleave", function(event) {
|
||||
document.addEventListener("mouseenter", function(event) {
|
||||
if(event.target.className == "card sticky-action") {
|
||||
var that = event.target;
|
||||
if(that.querySelector(".card-reveal") == null) return;
|
||||
that.querySelector(".card-reveal").setAttribute("style", "display: block;");
|
||||
clearTimeout(image_timeout);
|
||||
image_timeout = setTimeout(function(){
|
||||
|
||||
@@ -20,11 +20,13 @@
|
||||
<div class="card-action noselect">
|
||||
<span class="chan-link-element waves-effect waves-orange btn-flat">Listen</span>
|
||||
</div>
|
||||
|
||||
{{#if_equal description "This list has no description"}}
|
||||
{{else}}
|
||||
<div class="card-reveal">
|
||||
<span class="card-title grey-text text-darken-4 truncate">{{_id}}</span>
|
||||
<p class="description_text">{{description}}</p>
|
||||
</div>
|
||||
{{/if_equal}}
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user