|
|
|
@ -6,28 +6,18 @@
|
|
|
|
|
|
|
|
|
|
var Isotope = window.Isotope; |
|
|
|
|
|
|
|
|
|
function LayoutMode( isotope ) { |
|
|
|
|
this.isotope = isotope; |
|
|
|
|
// link options to isotope.options
|
|
|
|
|
this.options = isotope && isotope.options[ this.namespace ]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// -------------------------- create -------------------------- //
|
|
|
|
|
|
|
|
|
|
LayoutMode.create = function( namespace, options ) { |
|
|
|
|
// subclass LayoutMode
|
|
|
|
|
function Mode() { |
|
|
|
|
LayoutMode.apply( this, arguments ); |
|
|
|
|
Isotope.createLayoutMode = function( namespace, options ) { |
|
|
|
|
function LayoutMode( isotope ) { |
|
|
|
|
this.isotope = isotope; |
|
|
|
|
// link options to isotope.options
|
|
|
|
|
this.options = isotope && isotope.options[ this.namespace ]; |
|
|
|
|
} |
|
|
|
|
Mode.prototype = new LayoutMode(); |
|
|
|
|
Mode.prototype.namespace = namespace; |
|
|
|
|
LayoutMode.prototype.namespace = namespace; |
|
|
|
|
// set default options
|
|
|
|
|
Isotope.prototype.options[ namespace ] = options || {}; |
|
|
|
|
// register in Isotope
|
|
|
|
|
Isotope.layoutModes[ namespace ] = Mode; |
|
|
|
|
return Mode; |
|
|
|
|
Isotope.layoutModes[ namespace ] = LayoutMode; |
|
|
|
|
return LayoutMode; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
Isotope.LayoutMode = LayoutMode; |
|
|
|
|
|
|
|
|
|
})( window ); |
|
|
|
|