Skip to content

Commit

Permalink
New version of jquery ratings
Browse files Browse the repository at this point in the history
  • Loading branch information
Xpirix committed Feb 13, 2024
1 parent 936701a commit 96ef72a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions qgis-app/plugins/templates/plugins/plugin_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% block extrajs %}
{{ block.super }}
<script type="text/javascript" src="{% static "js/jquery.cookie.js" %}"></script>
<script type="text/javascript" src="{% static "jquery-ratings/jquery.ratings.js" %}"></script>
<script type="text/javascript" src="{% static "jquery-ratings/jquery.ratings.1.0.js" %}"></script>
<script type="text/javascript">

function csrfSafeMethod(method) {
Expand Down Expand Up @@ -87,7 +87,7 @@
</script>
{% endblock %}
{% block extracss %}
<link type="text/css" href="{% static "jquery-ratings/jquery.ratings.css" %}" rel="stylesheet" />
<link type="text/css" href="{% static "jquery-ratings/jquery.ratings.1.0.css" %}" rel="stylesheet" />
{{ block.super }}
<style>
.tooltip {
Expand Down
4 changes: 2 additions & 2 deletions qgis-app/static/jquery-ratings/example.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<html>
<head>
<link type="text/css" rel="stylesheet" href="jquery.ratings.css" />
<link type="text/css" rel="stylesheet" href="jquery.ratings.1.0.css" />
<script src="jquery-1.3.2.min.js"></script>
<script src="jquery.ratings.js"></script>
<script src="jquery.ratings.1.0.js"></script>
<script src="example.js"></script>
</head>
<body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ jQuery.fn.ratings = function(stars, initialRating) {
star.mouseenter(function() {
//Highlight selected stars.
for(var index = 0; index < this.rating; index++) {
starsCollection[index].removeClass('jquery-ratings-half-and-quarter');
starsCollection[index].removeClass('jquery-ratings-half');
starsCollection[index].removeClass('jquery-ratings-quarter');
starsCollection[index].addClass('jquery-ratings-full');
}
//Unhighlight unselected stars.
Expand Down Expand Up @@ -102,7 +105,7 @@ jQuery.fn.ratings = function(stars, initialRating) {
}
}
//Unhighlight unselected stars.
for(var index = containerElement.rating; index < stars ; index++) {
for(var index = Math.floor(containerElement.rating); index < stars ; index++) {
starsCollection[index].removeClass('jquery-ratings-full');
}
});
Expand Down

0 comments on commit 96ef72a

Please sign in to comment.