Skip to content

Instantly share code, notes, and snippets.

@ttdonovan
Created March 4, 2009 20:23
Show Gist options
  • Select an option

  • Save ttdonovan/73982 to your computer and use it in GitHub Desktop.

Select an option

Save ttdonovan/73982 to your computer and use it in GitHub Desktop.
CDWeb.BreadcrumbsView = SC.View.extend({
crumbs: [],
crumbsBinding: "CDWeb.breadcrumbsController.arrangedObjects",
tagName: 'ul',
layout: { left:0, right:0, top: 0, bottom:0 },
crumbsDidChangeObserver: function() {
console.log('crumbsDidChange', t = this);
this.$().html(this.get('crumbs').map(function(crumb) {
return ['<li>', '<a href="%@">'.fmt(crumb.get('url')), crumb.get('title'), '</a>', '</li>'].join('');
}, this).join(''));
console.log(this.$().html());
}.observes('crumbs')
}) ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment