Jump to content

[BUG] Percent sign not showing after usage percentage number in product details page.


sparkks

Recommended Posts

I do apologize for the following:

  • If this is the wrong community to post this bug but I'm new so... yeah.
  • If this issue has already been discussed. I did a tiny bit of searching, but couldn't find anything.
  • The Post Title; I tried to create a title that would be as simplistic as possible while being descriptive to reach the most amount of users searching for this issue.  

---

TL;DR

Bug: jQuery Knob Format function is not working ( i.e: Percent sign is not displaying after usage statistic percentage on the product details page )

Fix: Update jQuery Knob from the currently installed version of 1.2.0 to latest version of 1.2.12. 

---

I was trying to figure out why the format function for jQuery Knob was not displaying the percent sign behind the usage percentage number on the product details page...

image.png.3ab4141021a538ef90559cd247da3e82.png

Here's the default code:

<script src="{$BASE_PATH_JS}/jquery.knob.js"></script>
<script type="text/javascript">
  jQuery(function() {
    jQuery(".usage-dial").knob({
      'format': function (value) {
        return value + '%';
      }
    });
  });
</script>

I found that snip of code in the "/modules/servers/cpanel/templates/overview.tpl" file, but I'm sure it can be found else where as well. (That piece of code is not the problem.)  

Everything look to be fine, but after scrolling through the "assets/js/jquery.knob.js" file to troubleshoot, I noticed that there wasn't a format function in this file.

I then scroll up to the top of the file to try to find the credit section to instantly notice that it's out of date

image.png.d05fca1d80634d747a7d2490a5c2476d.png

I did find out that jQuery Knob did not release the format function until version 1.2.6. [source

So I just updated the old version (1.2.0) with the newest version (1.2.12) and presto!

image.png.ca34aca55d352177d06c763fb15ab3ba.png

The version 1.2.12 source I used was from here: https://github.com/aterrien/jQuery-Knob/blob/master/js/jquery.knob.js

 

Link to comment
Share on other sites

On 02/12/2019 at 05:45, sparkks said:

I do apologize for the following:

  • If this is the wrong community to post this bug but I'm new so... yeah.
  • If this issue has already been discussed. I did a tiny bit of searching, but couldn't find anything.
  • The Post Title; I tried to create a title that would be as simplistic as possible while being descriptive to reach the most amount of users searching for this issue.  

well done for taking the time to post this - the v7.9 beta 1 is still using the old knob file, so hopefully later beta releases will include the updated version of knob to fix this bug.

I can confirm updating that file in v7.8.3 does fix the percentage display issue.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated