/** * Sitewide Javascript */ jQuery(function($) { /* * Fallback for HTML5 placeholder attribute */ $('textarea[placeholder]').simplePlaceholder(); $('input:text[placeholder]').simplePlaceholder(); /* * filter dropdowns */ $(document).on('click','.dropdownwrap',function(){ var listbox = $(this); var droplist = listbox.find('ul'); if (droplist.hasClass('open')){ droplist.removeClass('open').slideUp('fast'); } else { $('.dropdownwrap ul.open').slideUp('fast').removeClass('open'); listbox.find('ul').stop(true, true).slideToggle('fast').addClass('open'); } }); /* * Info popups - e.g. for user, brand info * * Add .info-popup class to any item and the link will be loaded by ajax and displayed in a popup * The element must specify the page to load for content either in href or data-url attribute * * NOTE - other classes bound (e.g. a.item-info-button) are for compatibility with old code only and should not be used */ $(document).on('click', '.info-popup, a.item-info-button', function(e){ e.preventDefault(); //use data-url attribute, or href if data-url is not specified var loc = $(this).attr('data-url'); if( !loc ){loc = $(this).attr('href');} //insert popup containers $('
').addClass('popup-overlay').prependTo('body'); $('