1/*! 2 * Masonry layout mode 3 * sub-classes Masonry 4 * http://masonry.desandro.com 5 */ 6 7( function( window, factory ) { 8 'use strict'; 9 // universal module definition 10 if ( typeof define == 'function' && define.amd ) { 11 // AMD 12 define( [ 13 '../layout-mode', 14 'masonry/masonry' 15 ], 16 factory ); 17 } else if ( typeof exports == 'object' ) { 18 // CommonJS 19 module.exports = factory( 20 require('../layout-mode'), 21 require('masonry-layout') 22 ); 23 } else { 24 // browser global 25 factory( 26 window.Isotope.LayoutMode, 27 window.Masonry 28 ); 29 } 30 31}( window, function factory( LayoutMode, Masonry ) { 32'use strict'; 33 34// -------------------------- helpers -------------------------- // 35 36// extend objects 37function extend( a, b ) { 38 for ( var prop in b ) { 39 a[ prop ] = b[ prop ]; 40 } 41 return a; 42} 43 44// -------------------------- masonryDefinition -------------------------- // 45 46 // create an Outlayer layout class 47 var MasonryMode = LayoutMode.create('masonry'); 48 49 // save on to these methods 50 var _getElementOffset = MasonryMode.prototype._getElementOffset; 51 var layout = MasonryMode.prototype.layout; 52 var _getMeasurement = MasonryMode.prototype._getMeasurement; 53 54 // sub-class Masonry 55 extend( MasonryMode.prototype, Masonry.prototype ); 56 57 // set back, as it was overwritten by Masonry 58 MasonryMode.prototype._getElementOffset = _getElementOffset; 59 MasonryMode.prototype.layout = layout; 60 MasonryMode.prototype._getMeasurement = _getMeasurement; 61 62 var measureColumns = MasonryMode.prototype.measureColumns; 63 MasonryMode.prototype.measureColumns = function() { 64 // set items, used if measuring first item 65 this.items = this.isotope.filteredItems; 66 measureColumns.call( this ); 67 }; 68 69 // HACK copy over isOriginLeft/Top options 70 var _manageStamp = MasonryMode.prototype._manageStamp; 71 MasonryMode.prototype._manageStamp = function() { 72 this.options.isOriginLeft = this.isotope.options.isOriginLeft; 73 this.options.isOriginTop = this.isotope.options.isOriginTop; 74 _manageStamp.apply( this, arguments ); 75 }; 76 77 return MasonryMode; 78 79}));
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.