fixed subscriptions webform interactivity
This commit is contained in:
@ -31,8 +31,7 @@ function initViewmodes(){checkViewmodesResponsive();};function checkViewmodesRes
|
||||
if($('.viewmode-link.active.viewmode-'+vm).size())
|
||||
return vm;};function initFlagsEvent(){$('.bookmarks, .mylists .flaged').children('.node:not(.listened)').bind('mouseenter mousemove click mouseleave',onCardEventDispatcher).addClass('listened');};function onAfterFlaging(event){var $target=$(event.link).parents('article.node');if(event.flagStatus=='flag'){$target.addClass('flaged');}else if(event.flagStatus=='unflag'){if($('.flag-lists-entity-links a.unflag-action',$target).length==0)
|
||||
$target.removeClass('flaged');}};function onMybookmarksBlockUpdate(event){initFlagsEvent();initLayout();};function onClickList(event){var $link=$(event.currentTarget).addClass('active'),name=$link.attr('name'),$block=$link.parents('.block'),$flaged=$('.flaged.'+name,$block).addClass('active');$link.siblings().removeClass('active');$flaged.siblings().removeClass('active');createCookie('materiomyflaglistsopened',name,1);$flaged.parents('.mylists').height($flaged.h());initLayout();};function onMyListsBlockUpdate(event){initFlagsEvent();initLayout();};function onMyListsBlockBuilded(event){showLazyLoadedImages(event.block);};MaterioBaseTheme.prototype.on_mouseenter_bookmark=function(event){_$tooltip.html($('.group-header',this).clone()).css({top:event.pageY-_$tooltip.h()-5,left:event.pageX+5+($(this).w()-event.layerX)}).removeClass('op-hidden').addClass('op-visible');};MaterioBaseTheme.prototype.on_mousemove_bookmark=function(event){_$tooltip.css({top:event.pageY-_$tooltip.h()-5,left:event.pageX+5+($(this).w()-event.layerX)});};MaterioBaseTheme.prototype.on_mouseleave_bookmark=function(event){$('.images img.op-visible',this).removeClass('op-visible').addClass('op-hidden').eq(0).removeClass('op-hidden').addClass('op-visible');_$tooltip.removeClass('op-visible').addClass('op-hidden');};function initKeyboardShortcuts(){$(document).bind('keydown','Shift+:',shortcut_focusSearchField).bind('keydown','/',shortcut_focusSearchField).bind('keydown','Alt+1',shortcut_viewmodeSmall).bind('keydown','Alt+2',shortcut_viewmodeMedium).bind('keydown','Alt+3',shortcut_viewmodeBig).bind('keydown','Alt+4',shortcut_viewmodeFull).bind('keydown','space',shortcut_togglePreview).bind('keydown','esc',shortcut_closeModaleContent).bind('keydown','up',shortcut_onUpArrow).bind('keydown','right',shortcut_onRightArrow).bind('keydown','down',shortcut_onDownArrow).bind('keydown','left',shortcut_onLeftArrow);};function shortcut_focusSearchField(e){if($('#edit-searchfield').size()){var stat_event={type:'record-stat',categorie:'Shortcuts'};stat_event.action='slash';stat_event.label='Focus on search text field';$.event.trigger(stat_event);$('#edit-searchfield').focus();e.stopPropagation();e.preventDefault();return false;}};function shortcut_viewmodeSmall(e){if($('a.viewmode-link.viewmode-cardsmall').size()){var stat_event={type:'record-stat',categorie:'Shortcuts'};stat_event.action='Alt+1';stat_event.label='Change view mode : card small';$.event.trigger(stat_event);$('a.viewmode-link.viewmode-cardsmall').click();return false;}};function shortcut_viewmodeMedium(e){if($('a.viewmode-link.viewmode-cardmedium').size()){var stat_event={type:'record-stat',categorie:'Shortcuts'};stat_event.action='Alt+2';stat_event.label='Change view mode : card medium';$.event.trigger(stat_event);$('a.viewmode-link.viewmode-cardmedium').click();return false;}};function shortcut_viewmodeBig(e){if($('a.viewmode-link.viewmode-cardbig').size()){var stat_event={type:'record-stat',categorie:'Shortcuts'};stat_event.action='Alt+3';stat_event.label='Change view mode : card big';$.event.trigger(stat_event);$('a.viewmode-link.viewmode-cardbig').click();return false;}};function shortcut_viewmodeFull(e){if($('a.viewmode-link.viewmode-cardfull').size()){var stat_event={type:'record-stat',categorie:'Shortcuts'};stat_event.action='Alt+4';stat_event.label='Change view mode : card full';$.event.trigger(stat_event);$('a.viewmode-link.viewmode-cardfull').click();return false;}};function shortcut_togglePreview(e){$.event.trigger({type:'record-stat',categorie:'Shortcuts',action:'Space',label:'Space toggle preview'});if(_previewIsOpen){if($('body>.modal-wrapper').size()){$('body>.modal-wrapper').click();_previewIsOpen=false;return false;}}else{previewCard($('#content .search-results, #content .actuality-items').children('.node.focused:first'));}};function shortcut_closeModaleContent(e){if($('body>.modal-wrapper').size()){$.event.trigger({type:'record-stat',categorie:'Shortcuts',action:'Esc',label:'Esc from modal content'});$('body>.modal-wrapper').click();_previewIsOpen=false;return false;}};function shortcut_onUpArrow(e){moveGridFocus(e,'u');};function shortcut_onRightArrow(e){moveGridFocus(e,'r');};function shortcut_onDownArrow(e){moveGridFocus(e,'d');};function shortcut_onLeftArrow(e){moveGridFocus(e,"l");};function onResizeWindow(e){clearInterval(_resizeTimer);_resizeTimer=setTimeout(function(){initLayout();checkViewmodesResponsive();setUpGrid("#content .actuality-items, #content .search-results");},200);};function initMembershipForm(){switch(window.location.hash){case'#a':$('#edit-submitted-column-left-membership-options-1').attr('checked','checked');break;case'#b':$('#edit-submitted-column-left-membership-options-2').attr('checked','checked');break;case'#c':$('#edit-submitted-column-left-membership-options-3').attr('checked','checked');break;}
|
||||
$('#webform-component-column-left--membership-options').change(function(event){if($('input[type="radio"]:checked',this).is('#edit-submitted-column-left-membership-options-3')){$('#webform-component-column-right--collaborators').show();}else{$('#webform-component-column-right--collaborators').hide();}
|
||||
$('div.form-item.selected',this).removeClass('selected');$('input[type="radio"]:checked',this).parents('div.form-item').addClass('selected');}).trigger('change');};$.fn.h=function(){if(this.css('height')==undefined)
|
||||
$('.webform-component--column-left--membership-options').change(function(event){$('div.form-item.selected',this).removeClass('selected');$('input[type="radio"]:checked',this).parents('div.form-item').addClass('selected');}).trigger('change');};$.fn.h=function(){if(this.css('height')==undefined)
|
||||
return 0;return parseInt(this.css('height'))+parseInt(this.css('padding-top'))+parseInt(this.css('padding-bottom'));};$.fn.w=function(){if(this.css('width')==undefined)
|
||||
return 0;return parseInt(this.css('width'))+parseInt(this.css('padding-left'))+parseInt(this.css('padding-right'));};function getDocHeight(){var D=document;return Math.max(Math.max(D.body.scrollHeight,D.documentElement.scrollHeight),Math.max(D.body.offsetHeight,D.documentElement.offsetHeight),Math.max(D.body.clientHeight,D.documentElement.clientHeight));};function viewport(){var e=window,a='inner';if(!('innerWidth'in window)){a='client';e=document.documentElement||document.body;}
|
||||
return{width:e[a+'Width'],height:e[a+'Height']};};function initDoubleSearchFormTabs(){var $searchblock=$('#block-materio-search-api-materio-search-api-search');var $tabs=$('<div>').addClass('searchform-tabs').prependTo($searchblock.children('.inner'));$('h4.form-title',$searchblock).each(function(index,el){$(el).attr('index',index).bind('click',function(e){var $this=$(this);var index=$this.attr('index');$('h4.form-title',$tabs).removeClass('active');$this.addClass('active');$('.msa-form-wrapper',$searchblock).removeClass('active').eq(index).addClass('active');createCookie('default-search-form',index);initLayout();}).appendTo($tabs);});var defaultIndex=readCookie('default-search-form')||0;$('h4.form-title',$tabs).eq(defaultIndex).addClass('active');$('.msa-form-wrapper',$searchblock).eq(defaultIndex).addClass('active');$searchblock.addClass('tabed');initLayout();};function initForms(){$('#edit-searchfield:not(.processed)').bind('focus',function(event){var $this=$(this);if($this.val()==$this.attr('default'))
|
||||
|
Reference in New Issue
Block a user