Skip to content
Permalink
Browse files

Fixed issue #14424: Ranking question totally hang browser with same h…

…eight

Dev: doing setChoiceHeight and setListHeight only one time when filter is done
Dev: waring : if EM was updated, maybe need to be fixed
  • Loading branch information...
Shnoulle committed Jan 12, 2019
1 parent 19b360e commit 06f3bf0d4e80d33053d9e032e53bb2ef5de9f246
Showing with 4 additions and 4 deletions.
  1. +4 −4 assets/packages/questions/ranking/scripts/ranking.js
@@ -99,7 +99,6 @@ var RankingQuestion = function (options) {
* Update answers after updating drag and drop part
*/
updateDragDropRank = function() {

$('#question' + questionId + ' .select-item select').val('');
$('#sortable-rank-' + questionId + ' li').each(function (index) {
$('#question' + questionId + ' .select-item select').eq(index).val($(this).data("value"));
@@ -126,7 +125,6 @@ var RankingQuestion = function (options) {
}
},
loadDragDropRank = function () {

// Update #relevance
$("[id^=" + relevancename + "]").val('0');
$('#sortable-rank-' + questionId + ' li').each(function () {
@@ -156,7 +154,8 @@ var RankingQuestion = function (options) {
setChoiceHeight();
});
/* Do it when a choice is shown/hidden by filter (mantis #14411) */
$('#question' + questionId).on('relevance:on relevance:off','.ls-choice',function (event, data) {
/* attach to the last one only , see #14424. This can need update when EM javascript was improved */
$('#question' + questionId).on('relevance:on relevance:off','.ls-choice:last',function (event, data) {
if(event.target != this) return;
data = $.extend({style:'hidden'}, data);
if(data.style == 'hidden') {
@@ -175,7 +174,8 @@ var RankingQuestion = function (options) {
$('#question' + questionId + ' .ls-choice').on('html:updated',function(){
setListHeight();
});
$('#question' + questionId).on('relevance:on relevance:off','.ls-choice', function (event, data) {
/* attach to the last one only , see #14424. This can need update when EM javascript was improved */
$('#question' + questionId).on('relevance:on relevance:off','.ls-choice:last', function (event, data) {
if(event.target != this) return;
data = $.extend({style:'hidden'}, data);
if(data.style == 'hidden') {

0 comments on commit 06f3bf0

Please sign in to comment.
You can’t perform that action at this time.