Permalink
Browse files

remove unnecessary checks, update readme with small demo app

  • Loading branch information...
bmcmahen committed Mar 18, 2013
1 parent b962259 commit 0e35deaa976c4b20d08a0bdb17e20d777de9ff1c
Showing with 6 additions and 10 deletions.
  1. +3 −1 Readme.md
  2. +3 −9 index.js
View
@@ -1,7 +1,9 @@
# Cast.js
-Cast helps you build beautiful, animated grid layouts. Supply an array of attributes, select your layout mode, and receive grid positions for rendering your own views, or let Cast automatically update and render the views for you. It's vanilla Javascript and inspired by [Isotope](https://github.com/desandro/isotope).
+Cast helps you build beautiful, animated grid layouts. Supply an array of attributes, select your layout mode, and receive grid positions for rendering your own views... or let Cast automatically update and render the views for you. It's vanilla Javascript and it's inspired by [Isotope](https://github.com/desandro/isotope).
+
+Check out the [demonstration](http://cast.meteor.com) built with Meteor.
## Installation
View
@@ -274,8 +274,7 @@ Cast.prototype.draw = function(options){
// Constructor
var Block = function(attributes, context){
this.context = context;
- this.attributes = {};
- this.attributes.hidden = true;
+ this.attributes = { hidden: true };
if (attributes) this.set(attributes);
};
@@ -285,17 +284,12 @@ Emitter(Block.prototype);
Block.prototype.set = function(attr){
var changed = false;
if (!attr) return;
- if (this.attributes)
- this.previousAttributes = clone(this.attributes);
+ this.previousAttributes = clone(this.attributes);
for (var key in attr) {
if (attr.hasOwnProperty(key)) {
this.attributes[key] = attr[key];
- if (this.previousAttributes) {
- if (this.attributes[key] !== this.previousAttributes[key]){
- changed = true;
- }
- } else {
+ if (this.attributes[key] !== this.previousAttributes[key]){
changed = true;
}
}

0 comments on commit 0e35dea

Please sign in to comment.