var $wallItem = $('#wall-item');
var wallItemTemplate = Handlebars.compile($('#wall-item-template').html());
var $wallOfFame = $('#wall-of-fame');
var hashChanged = function (e) {
var hash = window.location.hash;
if (hash && hash !== '#') {
var id = hash.substring(1);
getWallItem(id)
.then(renderWallItem)
.then(function (data) {
$wallOfFame.hide();
$wallItem.show();
})
.then(renderDate);
}
else {
$wallItem.hide();
$wallOfFame.show();
}
};
var revertDescrDates = function () {
var containerBody = $('.WOFSingleDescriptionBody');
containerBody.children().each(function (i, oneDescr) { containerBody.prepend(oneDescr) });
}
var changeTimestampWidth = function () {
var visibleTimeline = [];
var timelineChildren = $('.timeline').children();
var timelineWidth = $('.timeline').width();
for (var i = 0; i < timelineChildren.length; i++) {
if ($(timelineChildren[i]).is(':visible')) {
visibleTimeline.push(timelineChildren[i]);
};
};
var newTimelineWidth = (timelineWidth - visibleTimeline.length) / visibleTimeline.length;