Customize Widget Header in Blox

Comments

2 comments

  • Avatar
    Tripti Jaiswal

    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);
    })

    0
    Comment actions Permalink
  • Avatar
    Delsaran Bigglesworth

    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.

    0
    Comment actions Permalink

Please sign in to leave a comment.