From cb94da90e0ba29c73f4358e529fc12b601330b03 Mon Sep 17 00:00:00 2001 From: David DeSandro Date: Thu, 6 Mar 2014 21:44:54 -0500 Subject: [PATCH] require js example --- examples/js/require-js.js | 36 +++++++++++++++++++++++++++++++----- examples/require-js.html | 2 +- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/examples/js/require-js.js b/examples/js/require-js.js index 591e974..cdb7218 100644 --- a/examples/js/require-js.js +++ b/examples/js/require-js.js @@ -6,7 +6,7 @@ requirejs.config({ baseUrl: '../bower_components' }); -requirejs( [ '../js/isotope', '../js/layout-modes/masonry' ], function( Isotope ) { +requirejs( [ '../js/isotope' ], function( Isotope ) { new Isotope( '#basic', { masonry: { columnWidth: 60 @@ -16,7 +16,7 @@ requirejs( [ '../js/isotope', '../js/layout-modes/masonry' ], function( Isotope // */ // isotope.pkgd.js -// /* +/* requirejs( [ 'js/isotope.pkgd.js' ], function( Isotope ) { new Isotope( '#basic', { layoutMode: 'masonry', @@ -27,18 +27,43 @@ requirejs( [ 'js/isotope.pkgd.js' ], function( Isotope ) { }); // */ -// isotope.pkgd.js and jQuery +// bower components and jQuery /* requirejs.config({ + baseUrl: '../bower_components', paths: { - jquery: '../../bower_components/jquery/jquery' + jquery: 'jquery/jquery' } }) +requirejs( [ + 'jquery', + 'isotope/js/isotope', + 'jquery-bridget/jquery.bridget' + ], + function( $, Isotope ) { + $.bridget( 'isotope', Isotope ); + $('#basic').isotope({ + masonry: { + columnWidth: 60 + } + }); +}); + +// */ + +// isotope.pkgd.js and jQuery +// /* +requirejs.config({ + paths: { + jquery: '../../bower_components/jquery/jquery' + } +}); + requirejs( [ 'require', 'jquery', 'js/isotope.pkgd.js' ], function( require, $, Isotope ) { require( [ - 'jquery-bridget/jquery.bridget', + 'jquery-bridget/jquery.bridget' ], function() { $.bridget( 'isotope', Isotope ); @@ -52,3 +77,4 @@ requirejs( [ 'require', 'jquery', 'js/isotope.pkgd.js' ], }); // */ + diff --git a/examples/require-js.html b/examples/require-js.html index b9223b4..4617a7c 100644 --- a/examples/require-js.html +++ b/examples/require-js.html @@ -6,7 +6,7 @@ require js - +