PageSourceSearch

https://nu.edu.pk/content/libs/isotope/fit-columns.js

js nu.edu.pk collected 2026-09-24 09:28:04 UTC 1,547 bytes, 73 lines download raw bytes

1/*!
2 * fitColumns layout mode for Isotope
3 * v1.1.2
4 * http://isotope.metafizzy.co/layout-modes/fitcolumns.html
5 */
6
7/*jshint browser: true, devel: false, strict: true, undef: true, unused: true */
8
9( function( window ) {
10
11'use strict';
12
13function fitColumnsDefinition( LayoutMode ) {
14
15  var FitColumns = LayoutMode.create('fitColumns');
16
17  FitColumns.prototype._resetLayout = function() {
18    this.x = 0;
19    this.y = 0;
20    this.maxX = 0;
21  };
22
23  FitColumns.prototype._getItemLayoutPosition = function( item ) {
24    item.getSize();
25
26    // if this element cannot fit in the current row
27    if ( this.y !== 0 && item.size.outerHeight + this.y > this.isotope.size.innerHeight ) {
28      this.y = 0;
29      this.x = this.maxX;
30    }
31
32    var position = {
33      x: this.x,
34      y: this.y
35    };
36
37    this.maxX = Math.max( this.maxX, this.x + item.size.outerWidth );
38    this.y += item.size.outerHeight;
39
40    return position;
41  };
42
43  FitColumns.prototype._getContainerSize = function() {
44    return { width: this.maxX };
45  };
46
47  FitColumns.prototype.needsResizeLayout = function() {
48    return this.needsVerticalResizeLayout();
49  };
50
51  return FitColumns;
52
53}
54
55if ( typeof define === 'function' && define.amd ) {
56  // AMD
57  define( [
58      'isotope/js/layout-mode'
59    ],
60    fitColumnsDefinition );
61} else if ( typeof exports === 'object' ) {
62  // CommonJS
63  module.exports = fitColumnsDefinition(
64    require('isotope-layout/js/layout-mode')
65  );
66} else {
67  // browser global
68  fitColumnsDefinition(
69    window.Isotope.LayoutMode
70  );
71}
72
73})( window );

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.