application/js/content.js in spontaneous-0.1.0.alpha1 vs application/js/content.js in spontaneous-0.2.0.alpha1
- old
+ new
@@ -31,10 +31,14 @@
},
type: function() {
return S.Types.type(this.content.type);
}.cache(),
+ slug: function() {
+ return this.content.slug;
+ },
+
constantize: function(type) {
var parts = type.split(/\./), obj = window;
for (var i = 0, ii = parts.length; i < ii; i++) {
obj = obj[parts[i]];
}
@@ -44,9 +48,12 @@
unload: function() {
$.each(this.field_list(), function(i, f) { f.unload(); });
$.each(this.entries(), function(i, e) { e.unload(); });
},
+ has_fields: function() {
+ return this.field_list().length > 0;
+ },
field_list: function() {
var type = this.type(), prototypes = type.field_prototypes, names = type.field_names;
var fields = this.fields(), list = [];
for (var i = 0, ii = names.length; i < ii; i++) {
list.push(fields[names[i]]);