Index: lams_central/web/includes/javascript/jquery.jRating.js =================================================================== diff -u -r7475d08afc280b5e2e5ddf04e8bf35e3166aaf80 -r1acfea216d78454faaa70cd91d807222c3b97d76 --- lams_central/web/includes/javascript/jquery.jRating.js (.../jquery.jRating.js) (revision 7475d08afc280b5e2e5ddf04e8bf35e3166aaf80) +++ lams_central/web/includes/javascript/jquery.jRating.js (.../jquery.jRating.js) (revision 1acfea216d78454faaa70cd91d807222c3b97d76) @@ -23,7 +23,11 @@ type : 'big', // can be set to 'small' or 'big' /** Boolean vars **/ - step:false, // if true, mouseover binded star by star, + + /** customized by LAMS **/ + step:false, // original: "if true, mouseover binded star by star" + // custom: step value, for example 0.5 to have mouse jump every half a star + isDisabled:false, showRateInfo: true, canRateAgain : false, @@ -131,7 +135,9 @@ mousemove : function(e){ var realOffsetLeft = findRealLeft(this); var relativeX = e.pageX - realOffsetLeft; - if(opts.step) newWidth = Math.floor(relativeX/starWidth)*starWidth + starWidth; + /** customized by LAMS **/ + if(opts.step) newWidth = Math.min(opts.rateMax * starWidth, + Math.floor(relativeX/(opts.step*starWidth))*(opts.step*starWidth) + opts.step*starWidth); else newWidth = relativeX; average.width(newWidth); if (opts.showRateInfo) @@ -193,7 +199,9 @@ var xPos = e.originalEvent.touches[0].pageX; var relativeX = xPos - realOffsetLeft; //Taken from mousemove - if(opts.step) newWidth = Math.floor(relativeX/starWidth)*starWidth + starWidth; + /** customized by LAMS **/ + if(opts.step) newWidth = Math.min(opts.rateMax * starWidth, + Math.floor(relativeX/(opts.step*starWidth))*(opts.step*starWidth) + opts.step*starWidth); else newWidth = relativeX; /*set vars*/