mirror of
https://github.com/vale981/Vulcan
synced 2025-03-09 12:16:37 -04:00
give names to callback functions
This commit is contained in:
parent
01ddf50c3e
commit
1f87ae90fc
2 changed files with 7 additions and 5 deletions
|
@ -69,8 +69,9 @@ var thumbnailHeightProperty = {
|
||||||
}
|
}
|
||||||
Settings.registerField(thumbnailHeightProperty);
|
Settings.registerField(thumbnailHeightProperty);
|
||||||
|
|
||||||
// add callback that adds "has-thumbnail" or "no-thumbnail" CSS classes
|
function addThumbnailClass (post, postClass){
|
||||||
Telescope.callbacks.register("postClass", function (post, postClass){
|
|
||||||
var thumbnailClass = !!post.thumbnailUrl ? "has-thumbnail" : "no-thumbnail";
|
var thumbnailClass = !!post.thumbnailUrl ? "has-thumbnail" : "no-thumbnail";
|
||||||
return postClass + " " + thumbnailClass;
|
return postClass + " " + thumbnailClass;
|
||||||
});
|
}
|
||||||
|
// add callback that adds "has-thumbnail" or "no-thumbnail" CSS classes
|
||||||
|
Telescope.callbacks.register("postClass", addThumbnailClass);
|
||||||
|
|
|
@ -62,7 +62,8 @@ getCategoryUrl = function(slug){
|
||||||
};
|
};
|
||||||
|
|
||||||
// add callback that adds categories CSS classes
|
// add callback that adds categories CSS classes
|
||||||
Telescope.callbacks.register("postClass", function (post, postClass){
|
function addCategoryClass (post, postClass){
|
||||||
var classArray = _.map(getPostCategories(post), function (category){return "category-"+category.slug});
|
var classArray = _.map(getPostCategories(post), function (category){return "category-"+category.slug});
|
||||||
return postClass + " " + classArray.join(' ');
|
return postClass + " " + classArray.join(' ');
|
||||||
});
|
}
|
||||||
|
Telescope.callbacks.register("postClass", addCategoryClass);
|
||||||
|
|
Loading…
Add table
Reference in a new issue