resize: function () {
this.ww = $(window).width();
this.hh = $(window).height();
- let intro_text_mobile = this.quiz.data.intro_text_mobile
- let intro_text = this.quiz.data.intro_text
+
+ if (this.isMobile()) {
+ $('html').addClass('m');
+ } else {
+ $('html').removeClass('m');
+ }
+
const iconReset = getSpriteIcon("quiz-reset")
const textReset = "Reset"
// Exécuter ici toutes opérations qui doivent intervenir lorsque la fenêtre est redimensionnée par le système ou l'utilisateur
//
- if(this.ww <= 390) {
- $("#welcome p").html(this.nl2br(intro_text_mobile))
- }else {
- $("#welcome p").html(this.nl2br(intro_text))
- }
-
+ this.quiz.screens.intro.resize(this.ww, this.hh);
//
- if(this.ww <= 992) {
+ if (this.ww <= 992) {
$(".btn.reset .text").html(iconReset)
} else {
$(".btn.reset .text").html(textReset)
}
+
+ },
+
+ isMobile: function () {
+ return this.ww <= 390;
},
- nl2br: function(str) {
- if (!str) return str;
- return str.replace(/(?:\r\n|\r|\n)/g, '<br>');
- }
}
export default QuizResize;
})
},
+ resize: function (ww, hh) {
+ let intro_text_mobile = this.quiz.data.intro_text_mobile
+ let intro_text = this.quiz.data.intro_text
+ if (ww <= 390) {
+ $("#welcome p").html(this.quiz.utils.nl2br(intro_text_mobile))
+ } else {
+ $("#welcome p").html(this.quiz.utils.nl2br(intro_text))
+ }
+ },
+
}
export default QuizScreenIntro;
return false;
}
return true;
- }
+ },
+
+ nl2br: function (str) {
+ if (!str) return str;
+ return str.replace(/(?:\r\n|\r|\n)/g, '<br>');
+ },
}
-export default QuizUtils;
\ No newline at end of file
+export default QuizUtils;