How do I remove the (+) vote prefix in ideation?

Former Member
Former Member

For feature requests that have a lot of upvotes (over 1000), the count is getting truncated. 

I have modified the theme stylesheets to change the font size, which has helped, but only if the sign is removed. The value displayed seems to be generated in compiled code and not in the widget itself.  My first attempt was to a CSS rule for .vote-score.positive:first-letter to make the font size 1px and transparent.  That actually works in most browsers, but there's a bug in Firefox where there's whitespace before the + that's being treated as the first letter.  The isn't that big of an issue b/c people rarely downvote in large numbers (if ever)

My current workaround is to add this code to the bottom of the Idea List widget, but it does cause a little bit of a flicker initially.  Also, I have to continually call it because paging through feature requests load new content via AJAX.

<script>
    var updateFn = function() {
        jQuery(".vote-score.positive").each((i, el) => { el.innerHTML = el.innerHTML.replace("+", "")});    
    };
    window.setInterval(updateFn, 500);
</script>



changed out image
[edited by: sonofagum at 8:09 PM (GMT 0) on Thu, Feb 11 2021]
Parents
  • It's correct that this isn't currently adjustable. That UI is provided by a supported but unfortunately undocumented ui-vote UI Component. Like other UI components, it's designed to be overriden by the theme to provide its own complete implementation or just an adjustment to how it invokes the out-of-the-box implementation, which in this case is the also presently-undocumented but supported evolutionUpDownVoting jQuery plugin. That said, this plugin also doesn't expose configuration for whether it renders the +/- modifier.

    Most other UI components and jQuery plugins in the API are documented. I'm logging the following item to both ensure ui-vote and evolutionUpDownVoting are documented as well as to adjust evolutionUpDownVoting to accept modifier configuration.

    TE-16551

    All that said, I'd recommend the following pure CSS workaround for now instead of a JavaScript-based approach.

    .ui-vote .vote-score.positive::first-letter {
        font-size: 0;
        line-height: 0;
        opacity: 0;
    }
    

Reply
  • It's correct that this isn't currently adjustable. That UI is provided by a supported but unfortunately undocumented ui-vote UI Component. Like other UI components, it's designed to be overriden by the theme to provide its own complete implementation or just an adjustment to how it invokes the out-of-the-box implementation, which in this case is the also presently-undocumented but supported evolutionUpDownVoting jQuery plugin. That said, this plugin also doesn't expose configuration for whether it renders the +/- modifier.

    Most other UI components and jQuery plugins in the API are documented. I'm logging the following item to both ensure ui-vote and evolutionUpDownVoting are documented as well as to adjust evolutionUpDownVoting to accept modifier configuration.

    TE-16551

    All that said, I'd recommend the following pure CSS workaround for now instead of a JavaScript-based approach.

    .ui-vote .vote-score.positive::first-letter {
        font-size: 0;
        line-height: 0;
        opacity: 0;
    }
    

Children