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({
|
var hbs = exphbs.create({
|
||||||
defaultLayout: publicPath + '/layouts/client/main',
|
defaultLayout: publicPath + '/layouts/client/main',
|
||||||
layoutsDir: publicPath + '/layouts/client',
|
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');
|
var uniqid = require('uniqid');
|
||||||
app.use(compression({filter: shouldCompress}))
|
app.use(compression({filter: shouldCompress}))
|
||||||
|
|||||||
@@ -110,12 +110,12 @@ var Frontpage = {
|
|||||||
card.querySelector(".chan-bg").setAttribute("style", img);
|
card.querySelector(".chan-bg").setAttribute("style", img);
|
||||||
card.querySelector(".chan-link").setAttribute("href", chan + "/");
|
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(".card-title").innerText = chan;
|
||||||
card.querySelector(".description_text").innerText = description;
|
card.querySelector(".description_text").innerText = description;
|
||||||
description = "";
|
description = "";
|
||||||
} else {
|
} else {
|
||||||
//card.querySelector(".card-reveal").remove();
|
card.querySelector(".card-reveal").remove();
|
||||||
Helper.removeClass(card.querySelector(".card"), "sticky-action")
|
Helper.removeClass(card.querySelector(".card"), "sticky-action")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -775,6 +775,7 @@ document.addEventListener("click", function(event) {
|
|||||||
document.addEventListener("mouseleave", function(event) {
|
document.addEventListener("mouseleave", function(event) {
|
||||||
if(event.target.className == "card sticky-action") {
|
if(event.target.className == "card sticky-action") {
|
||||||
var that = event.target;
|
var that = event.target;
|
||||||
|
if(that.querySelector(".card-reveal") == null) return;
|
||||||
that.querySelector(".card-reveal").setAttribute("style", "display: block;transform: translateY(0%);");
|
that.querySelector(".card-reveal").setAttribute("style", "display: block;transform: translateY(0%);");
|
||||||
clearTimeout(image_timeout);
|
clearTimeout(image_timeout);
|
||||||
image_timeout = setTimeout(function(){
|
image_timeout = setTimeout(function(){
|
||||||
@@ -786,6 +787,7 @@ document.addEventListener("mouseleave", function(event) {
|
|||||||
document.addEventListener("mouseenter", function(event) {
|
document.addEventListener("mouseenter", function(event) {
|
||||||
if(event.target.className == "card sticky-action") {
|
if(event.target.className == "card sticky-action") {
|
||||||
var that = event.target;
|
var that = event.target;
|
||||||
|
if(that.querySelector(".card-reveal") == null) return;
|
||||||
that.querySelector(".card-reveal").setAttribute("style", "display: block;");
|
that.querySelector(".card-reveal").setAttribute("style", "display: block;");
|
||||||
clearTimeout(image_timeout);
|
clearTimeout(image_timeout);
|
||||||
image_timeout = setTimeout(function(){
|
image_timeout = setTimeout(function(){
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
|
|
||||||
<i class="material-icons pin" style="{{#if pinned}}display:block;{{/if}}{{#unless pinned}}display:none;{{/unless}}">star_rate</i>
|
<i class="material-icons pin" style="{{#if pinned}}display:block;{{/if}}{{#unless pinned}}display:none;{{/unless}}">star_rate</i>
|
||||||
|
|
||||||
<p class="left-align">
|
<p class="left-align">
|
||||||
<span class="chan-name flow-text truncate">{{_id}}</span>
|
<span class="chan-name flow-text truncate">{{_id}}</span>
|
||||||
<br>
|
<br>
|
||||||
@@ -20,11 +20,13 @@
|
|||||||
<div class="card-action noselect">
|
<div class="card-action noselect">
|
||||||
<span class="chan-link-element waves-effect waves-orange btn-flat">Listen</span>
|
<span class="chan-link-element waves-effect waves-orange btn-flat">Listen</span>
|
||||||
</div>
|
</div>
|
||||||
|
{{#if_equal description "This list has no description"}}
|
||||||
|
{{else}}
|
||||||
<div class="card-reveal">
|
<div class="card-reveal">
|
||||||
<span class="card-title grey-text text-darken-4 truncate">{{_id}}</span>
|
<span class="card-title grey-text text-darken-4 truncate">{{_id}}</span>
|
||||||
<p class="description_text">{{description}}</p>
|
<p class="description_text">{{description}}</p>
|
||||||
</div>
|
</div>
|
||||||
|
{{/if_equal}}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
Reference in New Issue
Block a user