From f08077849f505a2b1ccc24d9c52859c385e61577 Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Thu, 15 Aug 2013 23:52:21 -0400 Subject: [PATCH] simply to Isotope.createLayoutMode --- layout-mode.js | 26 ++++++++------------------ layout-modes/fit-rows.js | 2 +- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/layout-mode.js b/layout-mode.js index f93bdd0..06af062 100644 --- a/layout-mode.js +++ b/layout-mode.js @@ -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 ); diff --git a/layout-modes/fit-rows.js b/layout-modes/fit-rows.js index 548d5bc..da7d523 100644 --- a/layout-modes/fit-rows.js +++ b/layout-modes/fit-rows.js @@ -4,7 +4,7 @@ var Isotope = window.Isotope; var Outlayer = window.Outlayer; -var FitRows = Isotope.LayoutMode.create( 'fitRows', { +var FitRows = Isotope.createLayoutMode( 'fitRows', { foo: 'bar' });