|
@@ -9,12 +9,15 @@
|
|
|
2015
|
|
|
*/
|
|
|
|
|
|
+
|
|
|
jQuery(document).ready(function($) {
|
|
|
// console.log('Hello Jee');
|
|
|
|
|
|
// http://stackoverflow.com/questions/2890898/preventing-mouse-emulation-events-ie-click-from-touch-events-in-mobile-safari
|
|
|
// FastClick.attach(document.body);
|
|
|
|
|
|
+
|
|
|
+
|
|
|
var _debug = false,
|
|
|
_avgDelay = 1,
|
|
|
_lastDraw = new Date,
|
|
@@ -344,24 +347,33 @@ jQuery(document).ready(function($) {
|
|
|
};
|
|
|
|
|
|
function initHashNav(){
|
|
|
+
|
|
|
if(window.location.hash !== ''){
|
|
|
// console.log("hash = "+window.location.hash);
|
|
|
var p = window.location.hash.match('^#principe-([0-9]+)$');
|
|
|
// console.log("p :", p);
|
|
|
if(p){
|
|
|
- // console.log($('li.node-readmore a[href="/node/'+p[1]+'"]', 'section#node-'+p[1]));
|
|
|
- setTimeout((function(nid){
|
|
|
- $('li.node-readmore a[href="/node/'+nid+'"]', 'section#node-'+nid).trigger('click').delay(1000).trigger('click');
|
|
|
- }(p[1])), 500);
|
|
|
- }else{
|
|
|
- var h = window.location.hash.match('^#(.+)$');
|
|
|
- // console.log("h :", h);
|
|
|
+ var hash = $('li.node-readmore a', 'section#node-'+p[1]).attr('href');
|
|
|
+ updateHash(hash);
|
|
|
+ }
|
|
|
+
|
|
|
+ var page = window.location.hash.match('^#/page/.+$');
|
|
|
+ var h = window.location.hash.match('^#(.+)$');
|
|
|
+ // console.log("h :", h);
|
|
|
+ if(page){
|
|
|
setTimeout((function(href){
|
|
|
$('a[href="'+href+'"]', '#block-menu-menu-footer-menu').trigger('click');
|
|
|
- }(h[1])), 500);
|
|
|
+ }(h[1])), 100);
|
|
|
+ }else{
|
|
|
+ setTimeout((function(href){
|
|
|
+ $('li.node-readmore a[href="'+href+'"]', 'section.node-chapitre').trigger('click').delay(1000).trigger('click');
|
|
|
+ }(h[1])), 100);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
};
|
|
|
/*
|
|
|
_____ _____ _____ _____ _____ _____ _____
|
|
@@ -427,6 +439,7 @@ jQuery(document).ready(function($) {
|
|
|
this.e = e;
|
|
|
this.$e = $(e);
|
|
|
this.nid = this.$e.attr("id").match(/^node-(\d+)/)[1];
|
|
|
+ this.hashref = $('li.node-readmore a', e).attr('href');
|
|
|
this.geom = {
|
|
|
base_a:base_a,
|
|
|
a:0,
|
|
@@ -789,10 +802,10 @@ jQuery(document).ready(function($) {
|
|
|
// |_____|__| |_____|_|___| |_____|__|__|__|__|__| |_| |_____|__|__|
|
|
|
|
|
|
Chapter.prototype.loadNode = function(e){
|
|
|
- console.log("Chapter :: open : nid", this.nid);
|
|
|
+ console.log("Chapter :: open : e", e);
|
|
|
|
|
|
// change hash address bar
|
|
|
- updateHash("principe-"+this.nid);
|
|
|
+ updateHash(this.hashref);
|
|
|
|
|
|
_$body.addClass('loading');
|
|
|
|