Skip to content

Commit

Permalink
Merge pull request #7435 from saraycp/top_sticky_flash
Browse files Browse the repository at this point in the history
Effect on flash and announcement when scrolling
  • Loading branch information
bgeuken committed Apr 23, 2019
2 parents ae05e03 + 61da83f commit 3b73e69
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 3b73e69

Please sign in to comment.