Skip to content

Commit

Permalink
Merge pull request #528 from Martii/Issue-520jQueryCSS3
Browse files Browse the repository at this point in the history
Eliminate the big gap from #527 with jQuery and CSS3

Auto-merge
  • Loading branch information
Martii committed Jan 13, 2015
2 parents f5565e6 + ddbd0e2 commit d90a970
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
17 changes: 15 additions & 2 deletions views/includes/scripts/commentReplyScript.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
<script type="text/javascript">
// Show spacer div
$('#reply-control').on('shown.bs.collapse', function () {
$('#show-reply-form-when-visible').css({
height: '200px'
});
});

// Hide spacer div
$('#reply-control').on('hidden.bs.collapse', function () {
$('#show-reply-form-when-visible').css({
height: '0'
});
});

$('.btn-comment-reply').click(function (aE) {
$('#reply-control').collapse('show');
Expand All @@ -20,7 +33,7 @@
});

function isElementInViewport(aEl) {
//special bonus for those using jQuery
// special bonus for those using jQuery
if (aEl instanceof jQuery) {
aEl = aEl[0];
}
Expand Down Expand Up @@ -53,7 +66,7 @@

var handler = fireIfElementVisible ($('#show-reply-form-when-visible'), callback);

//jQuery
// jQuery
$(window).on('DOMContentLoaded load resize scroll', handler);

</script>
8 changes: 7 additions & 1 deletion views/pages/discussionPage.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@
{{> includes/head.html }}
<link rel="stylesheet" type="text/css" media="all" href="/redist/npm/bootstrap-markdown/css/bootstrap-markdown.min.css">
<style>
#show-reply-form-when-visible { height: 200px; }
#show-reply-form-when-visible {
-moz-transition: height 1s ease;
-ms-transition: height 1s ease;
-o-transition: height 1s ease;
-webkit-transition: height 1s ease;
transition: height 1s ease;
}
</style>
</head>
<body>
Expand Down
8 changes: 7 additions & 1 deletion views/pages/scriptIssuePage.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
<link rel="stylesheet" type="text/css" media="all" href="/redist/npm/bootstrap-markdown/css/bootstrap-markdown.min.css">
<link rel="stylesheet" type="text/css" media="all" href="/css/scriptPage.css">
<style>
#show-reply-form-when-visible { height: 200px; }
#show-reply-form-when-visible {
-moz-transition: height 1s ease;
-ms-transition: height 1s ease;
-o-transition: height 1s ease;
-webkit-transition: height 1s ease;
transition: height 1s ease;
}
</style>
</head>
<body>
Expand Down

0 comments on commit d90a970

Please sign in to comment.