Customize Widget Header in Blox
Want to customize the widget header (change font style,font weight...etc) in Blox widget.
We have the Style widget title plugin,but it's not showing up in Blox.
Also, tried below script to customize the Widget Header.But Not working with Blox.
/********************************************************/
/********Change Widget Title Font and Size**********/
/********************************************************/ widget.on('ready', function(w,e){
var color = '#ffcb05';
var fontSize = '20px'
var fontWeight = 'bold'
var $widgetTitle = $('widget-title', element.parent()); var newCSS = {
'color':color,
'font-size':fontSize,
'font-weight':fontWeight
} $widgetTitle.css(newCSS); })
-
Use the below script at widget level.
Also,customization will get displayed on dashboard not inside widget edit.
widget.on('ready', function(w,e){
var color = '#000000';
var fontSize = '16px';
var fontWeight = 'bold';
var $widgetTitle = $('.widget-title__holder', element.parent());
var newCSS = {
'color':color,
'font-size':fontSize,
'font-weight':fontWeight
}
$widgetTitle.css(newCSS);
}) -
I found this the other day.
const widgetElement = prism.$ngscope.appstate === 'dashboard' ?
$('widget[widgetid="YOURWIDGETIDHERE"]') : undefined;and the when you do your Jquery, just pass in widgetElement. Like this
$('.widget-title__holder', widgetElement).css({
'color':color, 'font-size':fontSize, 'font-weight':fontWeight
});This should make it so that just the title of the one widget is styled.
Please sign in to leave a comment.
Comments
2 comments