Skip to content

Commit

Permalink
Fixed issue #14424: Ranking question totally hang browser with same h…
Browse files Browse the repository at this point in the history
…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 06f3bf0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions assets/packages/questions/ranking/scripts/ranking.js
Expand Up @@ -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"));
Expand All @@ -126,7 +125,6 @@ var RankingQuestion = function (options) {
}
},
loadDragDropRank = function () {

// Update #relevance
$("[id^=" + relevancename + "]").val('0');
$('#sortable-rank-' + questionId + ' li').each(function () {
Expand Down Expand Up @@ -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') {
Expand All @@ -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') {
Expand Down

0 comments on commit 06f3bf0

Please sign in to comment.