Skip to content
Snippets Groups Projects
Commit c54c48b3 authored by PavelBegunkov's avatar PavelBegunkov
Browse files

inspectors

parent 6277b24d
Branches
Tags
No related merge requests found
var $ = jQuery;
$(function() {
var inspectorCounter = 0;
var inspectorMax = 10;
var inspectorList;
$(function()
{
$('body').append('<div class="EventInspectorList"></div>');
inspectorList = $('div.EventInspectorList');
inspectorList.on('click', 'div.EventItem', function()
{
$(this).remove();
--inspectorCounter;
})
.on('mouseenter', 'div.EventItem.success', function()
{
$(this).css('border-color', '#96e186');
})
.on('mouseleave', 'div.EventItem.success', function(){
$(this).css('border-color', '#d6e9c6');
})
.on('mouseenter', 'div.EventItem.error', function()
{
$(this).css('border-color', '#f0aeae');
})
.on('mouseleave', 'div.EventItem.error', function(){
$(this).css('border-color', '#f2dede');
});
});
function EventInspector_ShowMsg(text, type){
var MsgDiv = $('.EventInspectorList').append('<div class="EventItem '+ type +'">' + text + '</div>').children().last();
function EventInspector_ShowMsg(text, type)
{
if (inspectorCounter >= inspectorMax)
inspectorList.children().first().remove();
++inspectorCounter;
var MsgDiv = inspectorList.append('<div class="EventItem '+ type +'">' + text + '</div>').children().last();
setTimeout(
function(){
MsgDiv.animate({opacity: 0}, 1000, function() {$(this).remove()});
--inspectorCounter;
MsgDiv.animate(
{opacity: 0},
1000,
function(){$(this).remove();}
);
},
5000
4000
);
$(window).scroll(function () {
if ($(this).scrollTop() > 40) {
$('.EventInspectorList').css('top', '20px');
......@@ -20,3 +58,7 @@ function EventInspector_ShowMsg(text, type){
}
});
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment