15 Jun '12, 6am

Simplifying View-View Events in Backbone using the Mediator Pattern

In most single-page apps, you will inevitably end up having multiple views on one page at a time. It usually starts out with just one view, and then that view needs to bind to events on a subview, and then the subview gets its own subview who will also trigger events that affect the top-level view... When you have one view that ties to one model, the standard way to set up the binding in Backbone looks something like MyView = Backbone.View.extend({ initialize: function() { this.model.bind("change:someProp", this.render, this); } // ... }); You might later find yourself binding view events in the same way: MySubView = Backbone.View.extend({ events: { "click li.foo": "fooSelected" }, fooSelected: function(e) { this.trigger("foo:selected", new Foo({id: $(e.target).data("fooId") })); } // ... }); MyView = Backbone.View.extend({ initialize: function() { this.model.bind("change:...

Full article: http://pivotallabs.com/users/mrushakoff/blog/articles/216...

Tweets

Coccyx: plug up those backbone leaks

pivotallabs.com 14 Jun '12, 6am

A number of projects at Pivotal have been using Backbone.js to build single page web apps. I've enjoyed using Backbone: it...

Google Street View sends hundreds of camera wielding trekkers cross country

Google Street View sends hundreds of camera wie...

cntraveller.com 15 Jun '12, 9am

There are some travellers who won't book a hotel without using Google's Street View service to check out the surrounding n...

Anybody seen an aircraft carrier around here? maybe one of the paddles on here can talk 'em down

Anybody seen an aircraft carrier around here? m...

navy.mil 16 Jun '12, 6pm

ARABIAN GULF (June 14, 2012) An F/A-18C Hornet assigned to the Vigilantes of Strike Fighter Squadron (VFA) 151 prepares to...

A helicopter takes off from USS James E. Williams:

A helicopter takes off from USS James E. Williams:

navy.mil 18 Jun '12, 7pm

RED SEA (June 12, 2012) An SH-60B Sea Hawk helicopter departs the flight deck during a recovery and assist exercise aboard...

#HappyFathersDay TY to all @usnavy Dads for sacrificing time with their families to keep us safe

#HappyFathersDay TY to all @usnavy Dads for sac...

navy.mil 17 Jun '12, 3pm

JOINT BASE ANDREWS, Md. (Nov 6, 2011) An aircrew member assigned to Electronic Attack Squadron (VAQ) 209 greets his loved ...

UK Reopens Google Street View Wi-Fi Investigation

UK Reopens Google Street View Wi-Fi Investigation

searchenginewatch.com 14 Jun '12, 5am

The Information Commissioner’s Office (ICO) has reopened its investigation into Google's Street View Wi-Fi collecting in l...

Using Orgasmic Yoga To Get In Touch With Your Sexuality

Using Orgasmic Yoga To Get In Touch With Your S...

care2.com 14 Jun '12, 7pm

One of the more challenging things for many people when it comes to sex is to find what really turns them on after having ...

A beautiful new 'Blue Marble' view of Earth from above the North Pole, courtesy Suomi @NASA_NPP.

A beautiful new 'Blue Marble' view of Earth fro...

earthobservatory.nasa.gov 22 Jun '12, 4am

There have been many images of the full disc of Earth from space —a view often referred to as “the Blue Marble” —but few h...

Good News on Using Recycled Sewage Treatment Plant Water for Irrigating Crops

Good News on Using Recycled Sewage Treatment Pl...

greenbuildingelements.com 14 Jun '12, 6pm

Eddie Cytryn and colleagues explain that a large fraction of antibiotics given to people or animals pass out of the body u...