Skip to content

Commit

Permalink
fixed issue #42
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardotkoller committed Feb 12, 2019
1 parent 8ed5172 commit d87f064
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions dist/jquery.convform.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ ConvState.prototype.printQuestion = function(){
}.bind(this), 500);
};
ConvState.prototype.printAnswers = function(answers, multiple){
var opened = false;
if(this.wrapper.find('div.options').height()!=0) opened = true;
this.wrapper.find('div.options div.option').remove();
if(multiple){
for(var i in answers){
Expand Down Expand Up @@ -156,10 +158,12 @@ ConvState.prototype.printAnswers = function(answers, multiple){
}
}
}
var diff = $(this.wrapper).find('div.options').height();
var originalHeight = $(this.wrapper).find('.wrapper-messages').height();
$(this.wrapper).find('.wrapper-messages').data('originalHeight', originalHeight);
$(this.wrapper).find('.wrapper-messages').css({marginBottom: diff, maxHeight: originalHeight-diff});
if(!opened) {
var diff = $(this.wrapper).find('div.options').height();
var originalHeight = $(this.wrapper).find('.wrapper-messages').height();
$(this.wrapper).find('.wrapper-messages').data('originalHeight', originalHeight);
$(this.wrapper).find('.wrapper-messages').css({marginBottom: diff, maxHeight: originalHeight-diff});
}

};
ConvState.prototype.answerWith = function(answerText, answerObject) {
Expand Down
Loading

0 comments on commit d87f064

Please sign in to comment.