Popover header now matches category color
This commit is contained in:
parent
a95936a490
commit
2845a734ef
@ -85,7 +85,15 @@ $(document).ready(function() {
|
||||
animation: true,
|
||||
container: 'body',
|
||||
placement: 'auto'
|
||||
}).popover('show');
|
||||
}).data('bs.popover')
|
||||
.tip()
|
||||
.css('padding', '0')
|
||||
.find('.popover-title')
|
||||
.css('background-color', event.color === '#fff' ? '#f7f7f7' : event.color)
|
||||
.addClass('background-volatile');
|
||||
|
||||
$eventMarkup.popover('show');
|
||||
refreshBackgroundVolatileItems();
|
||||
},
|
||||
eventMouseout: function() {
|
||||
$(this).popover('destroy');
|
||||
|
@ -74,7 +74,15 @@ $(document).ready(function() {
|
||||
animation: true,
|
||||
container: 'body',
|
||||
placement: 'auto'
|
||||
}).popover('show');
|
||||
}).data('bs.popover')
|
||||
.tip()
|
||||
.css('padding', '0')
|
||||
.find('.popover-title')
|
||||
.css('background-color', event.color === '#fff' ? '#f7f7f7' : event.color)
|
||||
.addClass('background-volatile');
|
||||
|
||||
$eventMarkup.popover('show');
|
||||
refreshBackgroundVolatileItems();
|
||||
},
|
||||
eventMouseout: function(event) {
|
||||
if (event.type === 'TICKET') {
|
||||
|
@ -98,7 +98,15 @@ $(document).ready(function() {
|
||||
animation: true,
|
||||
container: 'body',
|
||||
placement: 'auto'
|
||||
}).popover('show');
|
||||
}).data('bs.popover')
|
||||
.tip()
|
||||
.css('padding', '0')
|
||||
.find('.popover-title')
|
||||
.css('background-color', event.color === '#fff' ? '#f7f7f7' : event.color)
|
||||
.addClass('background-volatile');
|
||||
|
||||
$eventMarkup.popover('show');
|
||||
refreshBackgroundVolatileItems();
|
||||
},
|
||||
eventMouseout: function() {
|
||||
$(this).popover('destroy');
|
||||
|
@ -50,21 +50,7 @@ var loadJquery = function()
|
||||
$('.clockpicker').clockpicker();
|
||||
|
||||
// Set the proper text color for background-volatile elements
|
||||
$('.background-volatile').each(function() {
|
||||
$this = $(this);
|
||||
var background = $this.css('background-color');
|
||||
|
||||
if (background !== 'rgba(0, 0, 0, 0)'
|
||||
&& background !== 'transparent') {
|
||||
var grayCount = calculateGrayCount(background);
|
||||
|
||||
if (grayCount > 186) {
|
||||
$this.css('color', '#000');
|
||||
} else {
|
||||
$this.css('color', '#fff');
|
||||
}
|
||||
}
|
||||
});
|
||||
refreshBackgroundVolatileItems();
|
||||
|
||||
// Initialize colorpicker
|
||||
$('.colorpicker-trigger').colorpicker({
|
||||
@ -101,6 +87,24 @@ var loadJquery = function()
|
||||
})
|
||||
};
|
||||
|
||||
function refreshBackgroundVolatileItems() {
|
||||
$('.background-volatile').each(function() {
|
||||
$this = $(this);
|
||||
var background = $this.css('background-color');
|
||||
|
||||
if (background !== 'rgba(0, 0, 0, 0)'
|
||||
&& background !== 'transparent') {
|
||||
var grayCount = calculateGrayCount(background);
|
||||
|
||||
if (grayCount > 186) {
|
||||
$this.css('color', '#000');
|
||||
} else {
|
||||
$this.css('color', '#fff');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function calculateGrayCount(background) {
|
||||
var parts = background.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
|
||||
var red = parts[1];
|
||||
|
Loading…
x
Reference in New Issue
Block a user