some improvement
This commit is contained in:
@@ -172,6 +172,10 @@ jQuery(document).ready(function($) {
|
||||
})
|
||||
.on('mouseup', function(e){
|
||||
e.preventDefault();
|
||||
|
||||
if(e.target !== this)
|
||||
return false;
|
||||
|
||||
console.log('document mouseup');
|
||||
|
||||
if(_loaded_chapter || _loaded_static)
|
||||
@@ -207,7 +211,7 @@ jQuery(document).ready(function($) {
|
||||
}
|
||||
})
|
||||
.on('touchmove', function(e){
|
||||
// e.preventDefault();
|
||||
e.preventDefault();
|
||||
console.log('document touchmove');
|
||||
|
||||
if(_loaded_chapter || _loaded_static)
|
||||
@@ -482,15 +486,16 @@ jQuery(document).ready(function($) {
|
||||
// click to preview chapter
|
||||
// $('h2.node-title, .field-name-field-partie:first>.field-name-field-vignette', this.$e)
|
||||
this.$e
|
||||
.on('click', this, function(e){
|
||||
// e.stopImmediatePropagation();
|
||||
console.log('click on chapter');
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
.on('click',this.preview.bind(this))
|
||||
// .on('click', this, function(e){
|
||||
// // e.stopImmediatePropagation();
|
||||
// console.log('click on chapter');
|
||||
// e.stopPropagation();
|
||||
// e.preventDefault();
|
||||
|
||||
e.data.preview(e);
|
||||
return false;
|
||||
});
|
||||
// e.data.preview(e);
|
||||
// return false;
|
||||
// });
|
||||
|
||||
$('.links a', this.$e)
|
||||
.on('click', this, function(e){
|
||||
@@ -556,17 +561,21 @@ jQuery(document).ready(function($) {
|
||||
this.$e.translate3d({x:this.trans.x,y:this.trans.y});
|
||||
};
|
||||
|
||||
Chapter.prototype.preview = function(){
|
||||
Chapter.prototype.preview = function(e){
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
console.log('preview : e',e);
|
||||
console.log('preview : this',this);
|
||||
|
||||
// don't relaunch preview more that one time
|
||||
if(this.is_previewed) return false;
|
||||
|
||||
_previewed_chapter = this;
|
||||
|
||||
console.log('preview', this.i);
|
||||
|
||||
this.unMitigate();
|
||||
console.log('is_previewed', this.is_previewed);
|
||||
|
||||
this.is_previewed = true;
|
||||
_previewed_chapter = this;
|
||||
|
||||
this.unMitigate();
|
||||
|
||||
// close other chapters
|
||||
for (var i = _chapitres_len - 1; i >= 0; i--)
|
||||
@@ -575,7 +584,7 @@ jQuery(document).ready(function($) {
|
||||
|
||||
this.displayPreview();
|
||||
|
||||
// moveToChapter(this);
|
||||
return false;
|
||||
};
|
||||
|
||||
Chapter.prototype.displayPreview = function(e){
|
||||
|
||||
Reference in New Issue
Block a user