diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 2cf40d9a9..6c6ce41ab 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -17,6 +17,7 @@ - fixed #9950: Wrong var in help for thread - fixed #9956: Product Import - added Survey now has a loading mask on Survey edit ajax calls. + - fixed: Sliders fixed. Improved algorithm for determining pixel step size. 7.6.14 - fixed: IE6 shows Admin Bar over Asset Manager diff --git a/docs/upgrades/packages-7.7.0/root_import_survey_default-questions.wgpkg b/docs/upgrades/packages-7.7.0/root_import_survey_default-questions.wgpkg index 0465335bf..97748ad2a 100644 Binary files a/docs/upgrades/packages-7.7.0/root_import_survey_default-questions.wgpkg and b/docs/upgrades/packages-7.7.0/root_import_survey_default-questions.wgpkg differ diff --git a/www/extras/wobject/Survey/administersurvey.js b/www/extras/wobject/Survey/administersurvey.js index a91b42696..376bd4175 100644 --- a/www/extras/wobject/Survey/administersurvey.js +++ b/www/extras/wobject/Survey/administersurvey.js @@ -45,8 +45,10 @@ if (typeof Survey === "undefined") { function formsubmit(event){ var submit = 1;//boolean for if all was good or not for (var i in toValidate) { +console.log(toValidate); if (YAHOO.lang.hasOwnProperty(toValidate, i)) { var answered = 0; +console.log(toValidate[i].type); if (toValidate[i].type === 'Multi Slider - Allocate') { var total = 0; for (var z in toValidate[i].answers) { @@ -74,6 +76,7 @@ if (typeof Survey === "undefined") { } } var node = document.getElementById(i + 'required'); + var q_parent_node = YAHOO.util.Dom.getAncestorByClassName(node, 'question'); if (!answered) { submit = 0; @@ -209,7 +212,7 @@ if (typeof Survey === "undefined") { var step = Math.round(q.answers[i].step); var min = Math.round(parseFloat(q.answers[i].min)); var distance = Math.round(parseFloat(q.answers[i].max) + (-1 * min)); - var scale = Math.round(sliderWidth / distance); + var scale = Math.floor(sliderWidth / distance); var id = a.id; var s = YAHOO.widget.Slider.getHorizSlider(id + 'slider-bg', id + 'slider-thumb', 0, sliderWidth, (scale * step)); s.scale = scale; @@ -387,8 +390,9 @@ if (typeof Survey === "undefined") { } } - //Check if this question should be validated - if (q.required) { + //Check if this question should be validated. + //Sliders can't really be not answered, so requiring them makes little sense. + if (q.required == true && q.questionType != 'Slider') { toValidate[q.id] = []; toValidate[q.id].type = q.questionType; toValidate[q.id].answers = [];