Skip to content

Commit

Permalink
Effect on flash and announcement when scrolling
Browse files Browse the repository at this point in the history
When scrolling, the flash and announcement boxes get stuck on the top
and without space between each other.
  • Loading branch information
saraycp committed Apr 22, 2019
1 parent 26461c1 commit 61da83f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/api/app/assets/javascripts/webui2/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
//= require tokenfield.js
//= require webui2/plotbusyworkers.js
//= require webui2/datatables.js
//= require webui2/flash.js
//= require webui2/tabs.js
//= require webui2/requests_table.js
//= require webui2/attributes.js
Expand Down
7 changes: 7 additions & 0 deletions src/api/app/assets/javascripts/webui2/flash.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
$(window).scroll(function() {
if (this.scrollY > 100) {
$('.flash-and-announcement').addClass('sticking');
} else {
$('.flash-and-announcement').removeClass('sticking');
}
});
5 changes: 4 additions & 1 deletion src/api/app/assets/stylesheets/webui2/flash.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
.flash-and-announcement.sticky-top {
top: 1rem;
z-index: 1030;

&.sticking {
.alert { margin-bottom: 0; }
}
}

.alert-success {
Expand Down

0 comments on commit 61da83f

Please sign in to comment.