Merge branch 'hendrik-post' into 'master'

Hendrik post

See merge request !122
This commit was merged in pull request #126.
This commit is contained in:
Lars van Hijfte
2017-01-25 16:20:48 +01:00
11 changed files with 303 additions and 7 deletions

View File

@@ -1,5 +1,30 @@
margin = 20;
// scrolling modal taken from http://stackoverflow.com/questions/10476632/how-to-scroll-the-page-when-a-modal-dialog-is-longer-than-the-screen
function scrollbarMargin(width, overflow) {
$('body').css({
marginRight: width,
overflow: overflow
});
$('.profile-menu').css({
marginRight: width
});
}
function requestPost(post) {
$(".modal").show();
$.get(
"API/loadPost.php",
$(post).children("form").serialize()
).done(function (data) {
$('.modal-default').hide();
var scrollBarWidth = window.innerWidth - document.body.offsetWidth;
scrollbarMargin(scrollBarWidth, 'hidden');
$('#modal-response').show();
$('#modal-response').html(data);
});
}
$(window).on("load", function() {
console.log("LOADED");
container = $("div.posts");
@@ -69,8 +94,14 @@ function mansonry() {
column = $('<div class="column"></div>').append(columns[i][1]);
console.log(column);
container.append(column);
}
$("div.posts div.column").width(100/columnCount + "%");
$(".modal-close").click(function () {
$(".modal").hide();
scrollbarMargin(0, 'auto');
$('#modal-response').hide();
$('.modal-default').show();
});
}

View File

@@ -0,0 +1,8 @@
function loadPost(postID) {
$.get(
"API/loadPost.php",
$(postID).serialize()
).done(function (data) {
$('#modal-response').innerHTML= JSON.parse(data);
});
}