Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional Parameter width to the call of starCaptions and starCaptionClasses #180

Merged
merged 2 commits into from
May 25, 2019

Conversation

Bhoft
Copy link
Contributor

@Bhoft Bhoft commented Mar 26, 2018

Add additional Parameter to starCaptions and starCaptionClasses to have the width or percentage of highlighted stars in the called functions.

Scope

This pull request includes a

  • Bug fix
  • New feature
  • Translation

Changes

The following changes were made

  • only a parameter was added which is created by some internal function call

With this change it is possible to set the used starcaptionClass on percentage.

$this->pluginOptions['starCaptionClasses'] = new JsExpression("function(val, percentage){
            if (percentage !== undefined) {
                if (percentage <= 20) {
                     return 'label label-danger';
                }
                else if (percentage <= 40) {
                    return 'label label-warning';
                }
                else if (percentage <= 60) {
                    return 'label label-info';
                }
                else if (percentage <= 80) {
                    return 'label label-primary';
                }
                else { // if (percentage <= 100)
                    return 'label label-success';
                }
            }
        }");

So it is independent from the min, max and stars value.

…ptionClasses

Add additional Parameter to starCaptions and starCaptionClasses to have the width or percentage of highlighted stars in the called functions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants