Created
February 13, 2015 19:25
-
-
Save pivotal-casebook/530604b1b32d866cae42 to your computer and use it in GitHub Desktop.
data-presents old vs. new style
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Given this HTML: | |
// <div data-presents='foobar'></div> | |
// Old style | |
// Usually written by passing org.casebook.views | |
// to an anonymous function as `ns`. | |
org.casebook.views('foobar', { | |
initialize: function() { | |
var el = this | |
}, | |
}) | |
// New style | |
$(document).bind('foobar:present', function(event) { | |
var el = event.target | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment