Skip to content

Instantly share code, notes, and snippets.

@brendanmckenzie
Created April 21, 2012 15:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brendanmckenzie/8c8b71c2ee84fcb3eece to your computer and use it in GitHub Desktop.
Save brendanmckenzie/8c8b71c2ee84fcb3eece to your computer and use it in GitHub Desktop.
steal(
'jquery/controller',
'jquery/controller/view',
'jquery/view/mustache')
.then(
'./views/draft.mustache',
'./views/submitted.mustache', function ($) {
/**
* @class Ecm.Campaign.Show
*/
$.Controller('Ecm.Campaign.Show',
/** @Static */
{
defaults: {
}
},
/** @Prototype */
{
init: function (View, args) {
var that = this;
ECM.Models.Campaign.findOne(args, function (model) {
if (model.status == 0) {
that.element.replaceWith(that.view('draft.mustache', model));
}
else {
that.element.replaceWith(that.view('submitted.mustache', model));
}
});
},
'.delete clicked': function(ev, el) {
alert('delete?');
}
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment