search entries foldable
This commit is contained in:
@@ -12,6 +12,7 @@ if(typeof data.documents_lies!='undefined'){if(_corpus_ready){_$body.trigger({ty
|
||||
if(typeof data.block!='undefined'){if(!$('#'+data.block.id,'.region-'+data.block.region).length){$('.region-'+data.block.region).append(data.block.rendered);}}
|
||||
if(state.sys_path=="productions"){initProductions();}else{addCloseModalBtnToCols();}
|
||||
if(data.entity_type=="node"&&data.bundle=="enregistrement"&&data.view_mode=="transcript"){initEnregistrementTranscript();}
|
||||
if(state.sys_path=="search"){initSearch();}
|
||||
if(typeof data.translations_links!='undefined'){void 0;var lang_code=drupalSettings.path.currentLanguage;var $links=$(data.translations_links);$links.find('li[hreflang="'+lang_code+'"]').addClass('is-active').find('a').addClass('is-active');if(state.view_mode){$links.find('a').each(function(i,e){var $a=$(this);$a.attr('href',$a.attr('href')+'#'+state.view_mode);});}
|
||||
$('ul','.block.language-switcher-language-url').replaceWith($links);}
|
||||
initAjaxLinks();checkVisibleCorpusMapSpace();_$body.trigger({'type':'new-content-ajax-loaded'});Drupal.attachBehaviors(_$row[0]);_$body.attr('booted','booted');_$body.removeClass('ajax-loading');if(state.url){history.pushState(state,null,state.url);if(typeof _paq!=='undefined'){_paq.push(['setCustomUrl',state.url]);_paq.push(['setDocumentTitle',data.title]);_ajax_timing.end=performance.now();_paq.push(['setGenerationTimeMs',_ajax_timing.end-_ajax_timing.start]);_paq.push(['trackPageView']);}}};function initAudioLinksInContent(){_$row.find('a.audio-link').on('mouseover',function(event){event.preventDefault();if(_corpus_ready){_$corpus_canvas.trigger({type:'mouseover-audio-link',nid:$(this).attr('nid')});}}).on('mouseout',function(event){event.preventDefault();if(_corpus_ready){_$corpus_canvas.trigger({type:'mouseout-audio-link',nid:$(this).attr('nid')});}});};function addCloseModalBtnToCols(){$('.col',_$row).each(function(index,el){if($('span.close-col-btn',this).length)
|
||||
@@ -49,7 +50,7 @@ if(this.$playpause){if(this.playlist.length>0){this.$playpause.addClass('is-acti
|
||||
if(this.$next){if(this.playing&&this.playlist.length>1&&this.current_index<this.playlist.length-1){this.$next.addClass('is-active');}else{this.$next.removeClass('is-active');}}
|
||||
if(this.$previous){if(this.playing&&this.playlist.length>1&&this.current_index>0){this.$previous.addClass('is-active');}else{this.$previous.removeClass('is-active');}}
|
||||
return this;},deactivate(){this.stop();this.active=false;},onAudioOpenDocument(args){if(args.caller!==this){this.reset();}},onAudioPlayerPlay(){if(this.playing&&this.paused){this.paused=false;this.showHideControls();}},onAudioPlayerPause(){if(this.playing&&!this.paused){this.paused=true;this.showHideControls();}},onAudioPlayerEnded(){this.next();},};function initProductions(){void 0;_$row.find('.col').addClass('offfield');var $grid=$('.grid',_$row).masonry({itemSelector:'.col',columnWidth:'.col-2',horizontalOrder:true,containerStyle:null,transitionDuration:0,});$grid.imagesLoaded().progress(function(){$grid.masonry('layout');});$grid.imagesLoaded(function(){$grid.masonry('layout');});$grid.on('layoutComplete',checkProductionBlockVisible);};function checkProductionBlockVisible(e,items){void 0;for(var i in items){if(!items[i].isTransitioning){if(items[i].position.y+items[i].size.outerHeight<_$row.height()){$(items[i].element).removeClass('offfield');}else{$(items[i].element).addClass('offfield');}}}}
|
||||
function initEnregistrementTranscript(){void 0;var $node=_$row.find('article.node--type-enregistrement.node--view-mode-transcript');var $nav=$('<nav>').prependTo($node);$node.find('.field--name-field-transcript-vo').addClass('visible').find('.field__label').clone().appendTo($nav).addClass('is-active').attr('field_target','.field--name-field-transcript-vo');$node.find('.field--name-field-transcript-trad').find('.field__label').clone().appendTo($nav).attr('field_target','.field--name-field-transcript-trad');$nav.find('.field__label').on('click',function(){var $this=$(this).addClass('is-active');$this.siblings('.is-active').removeClass('is-active');$this.parents('article.node').find('.field.visible').removeClass('visible');$this.parents('article.node').find($this.attr('field_target')).addClass('visible');});};function backToFrontPage(pop_state){void 0;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){void 0;history.pushState({home:true},null,drupalSettings.path.baseUrl+drupalSettings.path.currentLanguage);}}
|
||||
function initSearch(){$('#edit-entries--wrapper legend','#edlp-search-form').on('click',function(){$(this).parent().toggleClass('opened');});};function initEnregistrementTranscript(){void 0;var $node=_$row.find('article.node--type-enregistrement.node--view-mode-transcript');var $nav=$('<nav>').prependTo($node);$node.find('.field--name-field-transcript-vo').addClass('visible').find('.field__label').clone().appendTo($nav).addClass('is-active').attr('field_target','.field--name-field-transcript-vo');$node.find('.field--name-field-transcript-trad').find('.field__label').clone().appendTo($nav).attr('field_target','.field--name-field-transcript-trad');$nav.find('.field__label').on('click',function(){var $this=$(this).addClass('is-active');$this.siblings('.is-active').removeClass('is-active');$this.parents('article.node').find('.field.visible').removeClass('visible');$this.parents('article.node').find($this.attr('field_target')).addClass('visible');});};function backToFrontPage(pop_state){void 0;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){void 0;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');});}
|
||||
function closeAllModals(){_$row.html('');_$ajaxLinks.removeClass('is-active');_$body.trigger({'type':'all-modal-closed'});};function checkRowEmpty(){if(!$('.col',_$row).length){if(!_$body.is('.entity-type-taxonomy_term.bundle-entrees')){if(!_$body.is('.entity-type-node.bundle-page')){backToFrontPage();}else{_$corpus_canvas.trigger({'type':'scramble-collection'});}}else{$('.entree-content a.is-active').removeClass('is-active');}}};init();}
|
||||
$(document).ready(function($){if(drupalSettings.path.isFront){var edlptheme=new EdlpTheme();}else{$('body').attr('booted','booted');}});})(jQuery,Drupal,drupalSettings);
|
||||
File diff suppressed because one or more lines are too long
@@ -317,6 +317,10 @@
|
||||
initEnregistrementTranscript();
|
||||
}
|
||||
|
||||
if(state.sys_path == "search"){
|
||||
initSearch();
|
||||
}
|
||||
|
||||
// update the language switcher block if it comes in the response
|
||||
if(typeof data.translations_links != 'undefined'){
|
||||
console.log('state',state);
|
||||
@@ -1507,6 +1511,21 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ___ _
|
||||
// / __| ___ __ _ _ _ __| |_
|
||||
// \__ \/ -_) _` | '_/ _| ' \
|
||||
// |___/\___\__,_|_| \__|_||_|
|
||||
function initSearch(){
|
||||
// if($('#edit-entries input:checked', '#edlp-search-form').length){
|
||||
// $('#edit-entries--wrapper', '#edlp-search-form').toggleClass('opened');
|
||||
// }
|
||||
$('#edit-entries--wrapper legend', '#edlp-search-form').on('click', function(){
|
||||
$(this).parent().toggleClass('opened');
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
// ___ _ _ _
|
||||
// | __|_ _ _ _ ___ __ _(_)__| |_ _ _ ___ _ __ ___ _ _| |_
|
||||
// | _|| ' \| '_/ -_) _` | (_-< _| '_/ -_) ' \/ -_) ' \ _|
|
||||
|
||||
@@ -1154,6 +1154,47 @@ main[role="main"]{
|
||||
width:90%;
|
||||
}
|
||||
|
||||
#edit-entries--wrapper{
|
||||
legend{
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
width:100%;
|
||||
&:after{
|
||||
content: '\2304';
|
||||
font-size: 2em;
|
||||
font-weight: 200;
|
||||
display:inline-block;
|
||||
line-height: 0;
|
||||
letter-spacing: 0;
|
||||
// width:15px;
|
||||
height:13px;
|
||||
overflow: hidden;
|
||||
// text-align: center;
|
||||
// outline: 1px solid orange;
|
||||
float: right;
|
||||
margin-top: 0.5em 0 0 0;
|
||||
}
|
||||
}
|
||||
#edit-entries{
|
||||
overflow: hidden;
|
||||
height:1px;
|
||||
margin:0;
|
||||
transition: height 0.4s ease-in-out;
|
||||
}
|
||||
&.opened{
|
||||
legend:after{
|
||||
// content: '\2303';
|
||||
transform: rotateZ(180deg);
|
||||
transform-origin: center;
|
||||
margin-top: 0 0 0.5em 0;
|
||||
}
|
||||
#edit-entries{
|
||||
height:362px;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#edit-entries{
|
||||
.form-item{
|
||||
label, input{
|
||||
@@ -1249,6 +1290,7 @@ main[role="main"]{
|
||||
&:checked{background-color: var(--e-col-123);}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user