bmcmahen / cast Goto Github PK
View Code? Open in Web Editor NEWCreate animated grid layouts given an array of attributes.
Home Page: http://cast.meteor.com/
Create animated grid layouts given an array of attributes.
Home Page: http://cast.meteor.com/
Using Meteor 0.8.1.1, an error occurs when we have
Template.cast.rendered = function(){
var myCast = new cast();
})
Trace:
Exception from Deps afterFlush function function: TypeError: Cannot read property 'clientWidth' of undefined
at new Cast (http://localhost:3000/client/lib/cast.js?09f5c38d83c9ac871ec3d5f08d58063cd517753b:694:59)
at Object.Template.cast.rendered (http://localhost:3000/client/views/main/main.js?d2fe801001ae6ec5b7fc35108daaf489a7e7bd40:31:15)
at http://localhost:3000/packages/ui.js?f0696b7e9407b8f11e5838e7e7820e9b6d7fc92f:426:23
at _assign.flush (http://localhost:3000/packages/deps.js?91f1235baecd83915f7d3a7328526dbba41482be:345:13)
Similar error occurs when we use:
var el = document.getElementById('#cast');
var mycast = cast(el);
mycast.draw(renderTemplate);
Trace:
Uncaught TypeError: Cannot read property 'clientWidth' of undefined cast.js?09f5c38d83c9ac871ec3d5f08d58063cd517753b:694
Cast cast.js?09f5c38d83c9ac871ec3d5f08d58063cd517753b:694
Cast cast.js?09f5c38d83c9ac871ec3d5f08d58063cd517753b:682
(anonymous function) main.js?7cbfb50c9595b6864936d354e93935963eeaccd3:26
(anonymous function)
i'm not a fan of the big options objects anymore, at least for the constructor. We should also expect a dom element for the wrapper instead of specifying a String.
right now, we utilize the afterTransition utility to remove an element from the dom once it has finished animating. I suspect this probably works fine in ie8 & 9 since transitions aren't supported, but what about if we don't want transitions in a transition enabled browser? it leaves elements in the dom
Allow use of a callback to add more flexibility to rendering.
cast.render(function(el, doc){
if (doc.image) {
return 'some template string';
}
return 'another template string';
});
This is necessary for those who like to append their scripts to , or for frameworks like Meteor that do this automagically.
basically you can provide additional arguments, and it calls back every time something is rendered. leave the 'changed' and rendering function up to the user, then... this will make this lib a bit lighter that way, too.
to prevent unnecessary rerendering
when we pass in attributes and we call a layout method, the top, left, attributes are added to the attributes listing. then, when we call 'toJSON()' those positional attributes are included. we should probably keep a separate list of positional attributes.
often you'll just want to pass an array into one layout mode, instead of using the views and models that come with cast. we can still offer cast as a bigger library, but we it should be made up of multiple components...
i wrote those a long time ago, and they need some work...
only new or removed nodes change the views
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.