mobile responsive
This commit is contained in:
@@ -22,6 +22,7 @@ jQuery(document).ready(function($) {
|
||||
_$nav_cursor;
|
||||
|
||||
var _$body = $('body'),
|
||||
_is_mobile = $('html').is('.mobile'),
|
||||
_$header = $("#header"),
|
||||
_$chapitres = $('.node-chapitre', '#main'),
|
||||
_chapitres_len = _$chapitres.length,
|
||||
@@ -484,8 +485,15 @@ jQuery(document).ready(function($) {
|
||||
//http://technify.me/user-experience/javascript/jquery/trigger-custom-events-with-jquery/
|
||||
// click to preview chapter
|
||||
// $('h2.node-title, .field-name-field-partie:first>.field-name-field-vignette', this.$e)
|
||||
|
||||
this.$e
|
||||
.on('click',this.preview.bind(this))
|
||||
.on('click', this, function(e){
|
||||
if(_is_mobile){
|
||||
e.data.loadNode(e);
|
||||
}else{
|
||||
e.data.preview(e);
|
||||
}
|
||||
});
|
||||
// .on('click', this, function(e){
|
||||
// // e.stopImmediatePropagation();
|
||||
// console.log('click on chapter');
|
||||
@@ -771,14 +779,16 @@ jQuery(document).ready(function($) {
|
||||
console.log('Chapter :: displayNode '+this.nid);
|
||||
|
||||
// place text blocks
|
||||
this.texts_pos = shuffleArray([1,2,3,4]);
|
||||
this.$blocks
|
||||
.each(this.placeText.bind(this))
|
||||
.pep({
|
||||
allowDragEventPropagation:false,
|
||||
disableSelect:true,
|
||||
velocityMultiplier:1
|
||||
});
|
||||
if(!_is_mobile){
|
||||
this.texts_pos = shuffleArray([1,2,3,4]);
|
||||
this.$blocks
|
||||
.each(this.placeText.bind(this))
|
||||
.pep({
|
||||
allowDragEventPropagation:false,
|
||||
disableSelect:true,
|
||||
velocityMultiplier:1
|
||||
});
|
||||
}
|
||||
|
||||
// build video player
|
||||
this.buildVideos();
|
||||
@@ -846,10 +856,13 @@ jQuery(document).ready(function($) {
|
||||
this.dimvideo.h = (this.dimvideo.w * parseInt($first_vid.attr("height")))/parseInt($first_vid.attr("width"));
|
||||
}
|
||||
|
||||
// redim each iframe to fit
|
||||
|
||||
// add a mask on top of each iframe to avoid bad interaction with vimeo
|
||||
if(_is_mobile)
|
||||
this.$vids.after('<div class="mask"></div>');
|
||||
|
||||
// redim each iframe to fit
|
||||
this.$vids
|
||||
.after('<div class="mask"></div>')
|
||||
.each(this.redimVideo.bind(this))
|
||||
.each(this.setVidsEvents.bind(this));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user