1// ------------------------------------------------------------------------------------------- 2// 3// AVIA Magazine function for magazine sorting 4// 5// ------------------------------------------------------------------------------------------- 6(function($) 7{ 8 "use strict"; 9 10 var animating = false, 11 methods = { 12 13 switchMag: function(clicked, _self) 14 { 15 var current = $(clicked) 16 17 if(current.is('.active_sort') || animating) return; 18 19 var filter = current.data('filter'), 20 oldContainer = _self.container.filter(':visible'), 21 newContainer = _self.container.filter('.' + filter); 22 23 //switch Class 24 animating = true; 25 _self.sort_buttons.removeClass('active_sort'); 26 current.addClass('active_sort'); 27 28 //apply fixed heiht for transition 29 _self.magazine.height(_self.magazine.outerHeight()); 30 31 //switch items 32 oldContainer.avia_animate({opacity:0}, 200, function() 33 { 34 oldContainer.css({display:'none'}); 35 newContainer.css({opacity:0, display:'block'}).avia_animate({opacity:1}, 150, function() 36 { 37 _self.magazine.avia_animate({height: (newContainer.outerHeight() + _self.sort_bar.outerHeight())}, 150, function() 38 { 39 _self.magazine.height('auto'); 40 animating = false; 41 }); 42 43 }); 44 }); 45 } 46 }; 47 48 49 $.fn.aviaMagazine = function( options ) 50 { 51 if(!this.length) return; 52 53 return this.each(function() 54 { 55 var _self = {}; 56 57 _self.magazine = $(this), 58 _self.sort_buttons = _self.magazine.find('.av-magazine-sort a'); 59 _self.container = _self.magazine.find('.av-magazine-group'); 60 _self.sort_bar = _self.magazine.find('.av-magazine-top-bar'); 61 62 _self.sort_buttons.on('click', function(e){ e.preventDefault(); methods.switchMag(this, _self); } ); 63 }); 64 } 65 66}(jQuery));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.