Created
June 29, 2011 11:43
-
-
Save dcolthorp/1053694 to your computer and use it in GitHub Desktop.
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
// Translate our messages into expand directives. | |
var messageDirectives = $.map(ajaxResult, formatMessage); | |
// Replace the dashboard placeholder with a newly cloned | |
// DOM node copied from #message-template and expanded | |
// with our messages. | |
$("#dashboard .placeholder"). | |
replaceWith( | |
$("#messages-template"). | |
expand(messageDirectives)); | |
// Interpolate the most recent message directly into | |
// the existing sidebar element | |
$("#sidebar .latest-message"). | |
expandInPlace(messageDirectives[0]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment