|
@@ -15,6 +15,7 @@
|
|
|
start:0,
|
|
|
end:0
|
|
|
};
|
|
|
+ var _corpus_promise;
|
|
|
|
|
|
|
|
|
|
|
@@ -23,6 +24,11 @@
|
|
|
function init(){
|
|
|
console.log("EdlpTheme init()");
|
|
|
|
|
|
+ if(!drupalSettings.path.isFront)
|
|
|
+ return;
|
|
|
+
|
|
|
+ _deferred = initEvents();
|
|
|
+
|
|
|
_audioPlayer = new AudioPlayer();
|
|
|
_compoPlayer = new CompoPlayer();
|
|
|
|
|
@@ -30,11 +36,10 @@
|
|
|
|
|
|
initHistory();
|
|
|
|
|
|
- if(!drupalSettings.path.isFront)
|
|
|
- return;
|
|
|
-
|
|
|
- initEvents();
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
};
|
|
|
|
|
|
|
|
@@ -42,8 +47,15 @@
|
|
|
|
|
|
|
|
|
function initEvents(){
|
|
|
+
|
|
|
+ var $corpus_df = $.Deferred();
|
|
|
+ _corpus_promise = $corpus_df.promise();
|
|
|
+
|
|
|
_$body
|
|
|
- .on('corpus-map-ready', onCorpusMapReady)
|
|
|
+ .on('corpus-map-ready', function(e){
|
|
|
+ onCorpusMapReady(e);
|
|
|
+ $corpus_df.resolve();
|
|
|
+ })
|
|
|
.on('on-studio-chutier-updated', initAjaxLinks)
|
|
|
.on('studio-initialized', function(e){
|
|
|
_compoPlayer.newCompo();
|
|
@@ -247,6 +259,22 @@
|
|
|
$('a[data-drupal-link-system-path="'+menu_sys_path+'"]').addClass('is-active-trail');
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ if(typeof data.documents_lies != 'undefined'){
|
|
|
+ if(_corpus_ready){
|
|
|
+ _$body.trigger({
|
|
|
+ type:'ajax-node-loaded-linked-documents',
|
|
|
+ nids:data.documents_lies
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ _corpus_promise.done(function(){
|
|
|
+ _$body.trigger({
|
|
|
+ type:'ajax-node-loaded-linked-documents',
|
|
|
+ nids:data.documents_lies
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
@@ -378,12 +406,7 @@
|
|
|
}
|
|
|
|
|
|
$col.remove();
|
|
|
-
|
|
|
- if(!$('.col', _$row).length
|
|
|
- && !_$body.is('.entity-type-node.bundle-page')
|
|
|
- && !_$body.is('.entity-type-taxonomy_term.bundle-entrees')){
|
|
|
- backToFrontPage();
|
|
|
- }
|
|
|
+ checkRowEmpty();
|
|
|
};
|
|
|
|
|
|
|
|
@@ -625,6 +648,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
function onCorpusMapReady(e){
|
|
|
|
|
|
_corpus_ready = true;
|
|
@@ -1335,53 +1359,6 @@
|
|
|
|
|
|
};
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- function backToFrontPage(pop_state){
|
|
|
- console.log('backToFrontPage', pop_state);
|
|
|
- closeAllModals();
|
|
|
-
|
|
|
- $('body').removeClass().addClass('path-frontpage');
|
|
|
- $('a[data-drupal-link-system-path="<front>"]').addClass('is-active');
|
|
|
-
|
|
|
- _$corpus_canvas.trigger({'type':'close-all-entree'});
|
|
|
-
|
|
|
- if(typeof pop_state == "undefined" || !pop_state){
|
|
|
- console.log('backToFrontPage push state');
|
|
|
- history.pushState({home:true}, null, drupalSettings.path.baseUrl+drupalSettings.path.currentLanguage);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- function initHome(){
|
|
|
- addCloseModalBtnToCols();
|
|
|
-
|
|
|
-
|
|
|
- var $grid = $('.grid',_$row).masonry({
|
|
|
- itemSelector:'.col',
|
|
|
- columnWidth:'.col-2',
|
|
|
- horizontalOrder: true,
|
|
|
- containerStyle: null,
|
|
|
-
|
|
|
-
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- $grid.imagesLoaded().progress( function() {
|
|
|
- $grid.masonry('layout');
|
|
|
- });
|
|
|
-
|
|
|
- $grid.imagesLoaded(function(){
|
|
|
- $grid.masonry('layout');
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
@@ -1434,6 +1411,54 @@
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ function backToFrontPage(pop_state){
|
|
|
+ console.log('backToFrontPage', pop_state);
|
|
|
+ closeAllModals();
|
|
|
+
|
|
|
+ $('body').removeClass().addClass('path-frontpage');
|
|
|
+ $('a[data-drupal-link-system-path="<front>"]').addClass('is-active');
|
|
|
+
|
|
|
+ _$corpus_canvas.trigger({'type':'close-all-entree'});
|
|
|
+ _$corpus_canvas.trigger({'type':'scramble-collection'});
|
|
|
+
|
|
|
+ if(typeof pop_state == "undefined" || !pop_state){
|
|
|
+ console.log('backToFrontPage push state');
|
|
|
+ history.pushState({home:true}, null, drupalSettings.path.baseUrl+drupalSettings.path.currentLanguage);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function initHome(){
|
|
|
+ addCloseModalBtnToCols();
|
|
|
+
|
|
|
+
|
|
|
+ var $grid = $('.grid',_$row).masonry({
|
|
|
+ itemSelector:'.col',
|
|
|
+ columnWidth:'.col-2',
|
|
|
+ horizontalOrder: true,
|
|
|
+ containerStyle: null,
|
|
|
+
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ $grid.imagesLoaded().progress( function() {
|
|
|
+ $grid.masonry('layout');
|
|
|
+ });
|
|
|
+
|
|
|
+ $grid.imagesLoaded(function(){
|
|
|
+ $grid.masonry('layout');
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -1444,6 +1469,21 @@
|
|
|
_$row.html('');
|
|
|
_$ajaxLinks.removeClass('is-active');
|
|
|
_$body.trigger({'type':'all-modal-closed'});
|
|
|
+
|
|
|
+ };
|
|
|
+
|
|
|
+ function checkRowEmpty(){
|
|
|
+
|
|
|
+
|
|
|
+ if(!$('.col', _$row).length && !_$body.is('.entity-type-taxonomy_term.bundle-entrees')){
|
|
|
+ if(!_$body.is('.entity-type-node.bundle-page')){
|
|
|
+
|
|
|
+ backToFrontPage();
|
|
|
+ }else{
|
|
|
+
|
|
|
+ _$corpus_canvas.trigger({'type':'scramble-collection'});
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
|