Skip to content

Commit

Permalink
first site alpha release with just event calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
voodoohop committed Mar 18, 2014
1 parent 5c86f74 commit 8d9034c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
13 changes: 6 additions & 7 deletions masonrify.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ class Masonrify
@instances= {}

constructor: (container, options) ->
options = _.extend({itemSelector: ".masonry_element", stamp: ".stamped"}, options)
console.log("instantiating packery with options", options)
@_ms = new Packery(container, options)
options = _.extend({itemSelector: ".masonry_element", stamp: ".stamped", masonry: options}, options)
@_ms = new Isotope(container, options)

addItems: (items) -> @_ms.addItems(items)
appended: (div) -> @_ms.appended(div)
Expand Down Expand Up @@ -45,18 +44,18 @@ Meteor.startup ->
Masonrify.instances[this.data.id] = new Masonrify(this.firstNode, this.data)

Template.masonryContainer.masonryContainerId = ->
console.log("got masonry cont id", this.id)
#console.log("got masonry cont id", this.id)
this.id
Template.masonryElement.setContainerId = (arg1,arg2) ->
console.log("setContainerId", this, arg1,arg2)
#console.log("setContainerId", this, arg1,arg2)
return null
Template.masonryElement.rendered = (arg1, arg2) ->
console.log("masonryElement rendered", this)
#console.log("masonryElement rendered", this)
contId = getContainerId(this.data)
element = this.firstNode
Masonrify.instances[contId]?.appended(element)
imagesLoaded(this.firstNode, -> Masonrify.instances[contId]?.debouncedRelayout())


Template.masonryElement.destroyed = ->
Masonrify.instances[this.data]?.debouncedRelayout(true)
Masonrify.instances[getContainerId(this.data)]?.debouncedRelayout(true)
2 changes: 1 addition & 1 deletion package.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Package.on_use(function (api) {
'ui']
, 'client');

api.add_files(['packery/packery.pkgd.min.js', 'imagesloaded/imagesloaded.pkgd.js'], 'client');
api.add_files(['isotope/isotope-v2.pkgd.js', 'imagesloaded/imagesloaded.pkgd.js'], 'client');
api.add_files(['template.html'], 'client');
api.add_files(['masonry_style.css'], 'client');
api.add_files(['masonrify.coffee'], 'client');
Expand Down
4 changes: 2 additions & 2 deletions template.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<template name="masonryElement">
<div class="masonry_element {{#if stamped}} stamped {{stamped}} {{/if}}">
{{> content}}
{{> UI.contentBlock}}
</div>
</template>


<template name="masonryContainer">
<div class="masonry_container">
{{> content}}
{{> UI.contentBlock}}
</div>
</template>

0 comments on commit 8d9034c

Please sign in to comment.