vertical.js
966 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
( function( window ) {
'use strict';
function verticalDefinition( LayoutMode ) {
var Vertical = LayoutMode.create( 'vertical', {
horizontalAlignment: 0
});
Vertical.prototype._resetLayout = function() {
this.y = 0;
};
Vertical.prototype._getItemLayoutPosition = function( item ) {
item.getSize();
var x = ( this.isotope.size.innerWidth - item.size.outerWidth ) *
this.options.horizontalAlignment;
var y = this.y;
this.y += item.size.outerHeight;
return { x: x, y: y };
};
Vertical.prototype._getContainerSize = function() {
return { height: this.y };
};
return Vertical;
}
if ( typeof define === 'function' && define.amd ) {
// AMD
define( [
'../layout-mode'
],
verticalDefinition );
} else if ( typeof exports === 'object' ) {
// CommonJS
module.exports = verticalDefinition(
require('../layout-mode')
);
} else {
// browser global
verticalDefinition(
window.Isotope.LayoutMode
);
}
})( window );