I have a Backbone App bound together with RequireJS. Now I want to use the Wookmark plugin https://github.com/GBKS/Wookmark-jQuery but for some reason I cant get it running. So I did the following:
My config.js:
require.config({
deps: ['main'],
paths: {
jquery : '../lib/jquery-2.1.0.min',
underscore : '../lib/lodash-2.4.1',
backbone : '../lib/backbone',
layoutmanager : '../lib/backbone.layoutmanager',
handlebars : '../lib/handlebars/handlebars-v1.3.0',
imagesLoaded : '../lib/jquery.imagesloaded',
wookmark : '../lib/wookmark.min'
},
shim: {
backbone : {
deps : ['jquery', 'underscore'],
exports: 'Backbone'
},
handlebars: {
exports: 'Handlebars'
},
layoutmanager: ['backbone']
}
});
Then in my App.js I have:
define([
'jquery',
'underscore',
'backbone',
'wookmark',
'imagesLoaded',
'layoutmanager',
'handlebars'
],
function ($, _, Backbone, wookmark, imagesLoaded) {
// some code...
$(function() {
var tiles = $('#suptiles'),
handler = $('li', $tiles),
options = {
autoResize: true,
container: $('#supmain'),
offset: 10,
outerOffset: 15,
fillEmptySpace: true,
itemWidth: 280,
flexibleWidth: 500
};
$tiles.imagesLoaded(function() {
$handler.wookmark(options);
});
});
});
Then in my HTML file I did:
<div id="supmain">
<ul id="suptiles">
<li>some image</li>
<li>some image</li>
<li>some image</li>
<li>some image</li>
</ul>
</div>
I cna see in my console that both the wookmark
and imagesloaded
-plugins are loaded, buut it doesnt get triggered. Does anyone know what might be the issue here?
Thanks in advance....