Skip to content

Commit

Permalink
+ Fixed #46
Browse files Browse the repository at this point in the history
  • Loading branch information
cmllr committed Apr 7, 2017
1 parent e99bca7 commit 834e08f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
8 changes: 3 additions & 5 deletions index.php
Expand Up @@ -245,23 +245,21 @@ function echoStyles($data){
<label class="answer-text" :for="answer.id" v-bind:class="{ 'selected': answer.selected }">
{{ answer.text }}
</label>
<i v-on:click.prevent="showTooltip(translateExcludedTags(answer))" v-if="displayFilters && answer.notags.length > 0" class="fa fa-question-circle visible-xs visible-sm fa-question-exclude" :title = "translateExcludedTags(answer)"></i>
<i v-if="displayFilters && answer.notags.length > 0" class="fa fa-question-circle hidden-xs hidden-sm fa-question-exclude" :title = "translateExcludedTags(answer)"></i>
<i v-on:click.prevent="showTooltip(translateExcludedTags(answer),$event)" v-if="displayFilters && answer.notags.length > 0" class="fa fa-question-circle fa-question-exclude" data-placement='left' data-html="true" :data-title = "translateExcludedTags(answer)"></i>
</p>
<p v-if="!question.single">
<input :id="answer.id" v-model="answer.selected" :data-id="answer.id" :name="question.id + '_a'" type="checkbox" v-on:change="updateAnsweredFlag($event,answer,question)">
<label class="answer-text" :for="answer.id" v-bind:class="{ 'selected': answer.selected }">
{{ answer.text }}
</label>
<i v-on:click.prevent="showTooltip(translateExcludedTags(answer))" v-if="displayFilters && answer.notags.length > 0" class="fa fa-question-circle fa-question-exclude visible-xs visible-sm" :title = "translateExcludedTags(answer)"></i>
<i v-if="displayFilters && answer.notags.length > 0" class="fa fa-question-circle hidden-xs hidden-sm" :title = "translateExcludedTags(answer)"></i>
<i v-on:click.prevent="showTooltip(translateExcludedTags(answer),$event)" v-if="displayFilters && answer.notags.length > 0" class="fa fa-question-circle" data-placement='left' data-html="true" :data-title = "translateExcludedTags(answer)"></i>
</p>
</div>
</div>
<a href="#" :class="'btn btn-primary ' +question.id + '-next'" :data-id="question.id + '-next'" v-on:click.prevent="nextTrigger(question.id)" >
{{ lastQuestionNumber=== question.number ? text("getresult") : (question.number === -1 ? text("StartTest") :text("nextQuestion"))}}
</a>

<a v-if="lastQuestionNumber !== question.number && question.number !== -1" href="#" class="skip-question hidden-xs" v-on:click.prevent="nextTrigger(question.id)"><i class="fa fa-mail-forward"></i> {{ text("skip-question"); }}</a>
<a href="#" class="clear-answer" v-if="question.answered" v-on:click.prevent="removeAnswers(question)"><i class="fa fa-trash remove-answer"></i> {{ text("clear"); }}</a>
</div>
</div>
Expand Down
11 changes: 8 additions & 3 deletions ldc.css
Expand Up @@ -293,7 +293,8 @@ hr{
padding-left:2px;
color: rgba(56, 158, 72, 0.81);
font-size: 16px;
padding-right: 2px
padding-right: 2px;
cursor: pointer;
}
.fa-question-exclude{
top:2px;
Expand All @@ -302,7 +303,7 @@ hr{
right: -7px;
color: rgba(56, 158, 72, 0.81);
font-size: 16px;
cursor: help;
cursor: pointer;
padding-right: 2px
}
.answer-parent{
Expand Down Expand Up @@ -371,4 +372,8 @@ hr{
right: 30.5em;
width: 14em
}
}
}

.skip-question{
padding-left: 1em;
}
17 changes: 12 additions & 5 deletions ldc.js
Expand Up @@ -60,7 +60,8 @@ vm = new Vue({
"I'm older than three years!",
"this is a loading text!",
"what is this 'Windows' you talk about?"
]
],
i18nused: []
},
created: function(){
this.loadText();
Expand Down Expand Up @@ -201,18 +202,24 @@ vm = new Vue({
this.backend = this.backends.stetler;
}
},
showTooltip:function(tooltip){
alert(tooltip);
showTooltip:function(tooltip,event){
$(event.target).tooltip('show');
},
translateExcludedTags:function(answer){
var result = this.text('excludes') +": \n";
var result = this.text('excludes') +": <br>";
var _t = this;
answer.notags.forEach(function(t){
result += _t.text(t) + "\n";
var text = _t.text(t);
if (text !== ''){
result += _t.text(t) + "<br>";
}
});
return result.trim();
},
text:function(value){
if (this.i18nused.indexOf(value) === -1){
this.i18nused.push(value);
}
return this.i18n !== null &&typeof this.i18n[value] !== 'undefined'? this.i18n[value].val:'';
},
isTagChoosed:function(tag){
Expand Down

0 comments on commit 834e08f

Please sign in to comment.