mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-11-09 07:54:34 +08:00
add floating alert message
This commit is contained in:
parent
d8cf3b1f07
commit
a6a25bbe08
6 changed files with 29 additions and 37 deletions
|
|
@ -198,9 +198,6 @@ var HelperModule = (function(){
|
||||||
window.setTimeout(function () {
|
window.setTimeout(function () {
|
||||||
flash.fadeTo(500, 0).slideUp(500, function () {
|
flash.fadeTo(500, 0).slideUp(500, function () {
|
||||||
$(this).remove();
|
$(this).remove();
|
||||||
if($('.alert').length <= 0) {
|
|
||||||
$('#content-wrapper').removeClass('alert-shown');
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}, 5000);
|
}, 5000);
|
||||||
}
|
}
|
||||||
|
|
@ -234,7 +231,6 @@ var HelperModule = (function(){
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'</div>';
|
'</div>';
|
||||||
$('#notifications').html(htmlSnippet);
|
$('#notifications').html(htmlSnippet);
|
||||||
$('#content-wrapper').addClass('alert-shown');
|
|
||||||
helpers.hideFlashMsg();
|
helpers.hideFlashMsg();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -134,8 +134,7 @@
|
||||||
function notificationAlertClose() {
|
function notificationAlertClose() {
|
||||||
$('#notifications .alert').on('closed.bs.alert', function() {
|
$('#notifications .alert').on('closed.bs.alert', function() {
|
||||||
$('#content-wrapper')
|
$('#content-wrapper')
|
||||||
.addClass('alert-hidden')
|
.addClass('alert-hidden');
|
||||||
.removeClass('alert-shown');
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,6 @@ $(document).ready(function () {
|
||||||
$("#hide-alert").click(function(ev) {
|
$("#hide-alert").click(function(ev) {
|
||||||
$(this).closest("div.alert").addClass("alert-hidden");
|
$(this).closest("div.alert").addClass("alert-hidden");
|
||||||
$("#content-wrapper").addClass("alert-hidden");
|
$("#content-wrapper").addClass("alert-hidden");
|
||||||
$("#content-wrapper").removeClass("alert-shown");
|
|
||||||
|
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
|
|
|
||||||
|
|
@ -367,6 +367,33 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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
|
// reset margins on small screens
|
||||||
@media (max-width: 1188px) {
|
@media (max-width: 1188px) {
|
||||||
#nav-team-switch {
|
#nav-team-switch {
|
||||||
|
|
|
||||||
|
|
@ -59,14 +59,6 @@ table {
|
||||||
margin-right: 0.5em;
|
margin-right: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#content-wrapper {
|
|
||||||
margin-top: 50px;
|
|
||||||
|
|
||||||
&.alert-shown {
|
|
||||||
margin-top: 102px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.center-block-narrow {
|
.center-block-narrow {
|
||||||
max-width: 400px;
|
max-width: 400px;
|
||||||
}
|
}
|
||||||
|
|
@ -117,27 +109,6 @@ a {
|
||||||
background-color: inherit;
|
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 {
|
.badge {
|
||||||
background-color: $color-theme-primary;
|
background-color: $color-theme-primary;
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="content-wrapper" class="<%= "alert-shown" if flash[:success] || flash[:error] || notice || alert %>">
|
<div id="content-wrapper">
|
||||||
<%= yield :content %>
|
<%= yield :content %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue