Merge pull request #1037 from ZmagoD/zd_SCI_2142

Implement/update flash messages/alerts with regards to new navigation [fixes SCI-2142]
This commit is contained in:
Zmago Devetak 2018-03-16 17:22:33 +01:00 committed by GitHub
commit dc22e05b02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 39 deletions

View file

@ -198,9 +198,6 @@ var HelperModule = (function(){
window.setTimeout(function () {
flash.fadeTo(500, 0).slideUp(500, function () {
$(this).remove();
if($('.alert').length <= 0) {
$('#content-wrapper').removeClass('alert-shown');
}
});
}, 5000);
}
@ -234,7 +231,6 @@ var HelperModule = (function(){
'</div>' +
'</div>';
$('#notifications').html(htmlSnippet);
$('#content-wrapper').addClass('alert-shown');
helpers.hideFlashMsg();
}

View file

@ -36,7 +36,6 @@ $(document).ready(function () {
$("#hide-alert").click(function(ev) {
$(this).closest("div.alert").addClass("alert-hidden");
$("#content-wrapper").addClass("alert-hidden");
$("#content-wrapper").removeClass("alert-shown");
ev.preventDefault();
ev.stopPropagation();

View file

@ -175,11 +175,11 @@
/** Search */
.nav-search {
li.disabled {
opacity: 0.8;
opacity: .8;
.badge {
background-color: $color-emperor;
opacity: 0.8;
opacity: .8;
}
}
@ -353,8 +353,36 @@
}
}
// Alert
.alert {
border-radius: 0;
margin-bottom: 0;
opacity: .86;
width: 100%;
&.alert-hidden {
display: none;
}
a#hide-alert {
margin-left: 15px;
}
&.alert-floating {
position: fixed;
top: 50px;
z-index: 1000;
}
}
#content-wrapper {
margin-top: 50px;
}
// reset margins on small screens
@media (max-width: 1188px) {
#nav-team-switch {
margin-left: 0;
}

View file

@ -1,7 +1,7 @@
@import 'constants';
@import "mixins";
@import 'main_navigation';
@import 'buttons';
@import "main_navigation";
@import "buttons";
/** Layout **/
@ -58,14 +58,6 @@ table {
margin-right: 0.5em;
}
#content-wrapper {
margin-top: 50px;
&.alert-shown {
margin-top: 102px;
}
}
.center-block-narrow {
max-width: 400px;
}
@ -116,27 +108,6 @@ a {
background-color: inherit;
}
.alert {
border-radius: 0;
margin-bottom: 0;
opacity: 1;
width: 100%;
&.alert-hidden {
display: none;
}
a#hide-alert {
margin-left: 15px;
}
&.alert-floating {
position: fixed;
top: 50px;
z-index: 1000;
}
}
.badge {
background-color: $color-theme-primary;
font-size: 11px;

View file

@ -64,7 +64,7 @@
<% end %>
</div>
<div id="content-wrapper" class="<%= "alert-shown" if flash[:success] || flash[:error] || notice || alert %>">
<div id="content-wrapper">
<%= yield :content %>
</div>