Skip to content

@brendanmckenzie /gist:2cce7c5d884d7b379b74 secret
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
steal(
'jquery/controller',
function ($) {
/**
* @class Ecm.Router
*/
$.Controller('Ecm.Router',
/** @Static */
{
defaults: {}
},
/** @Prototype */
{
init: function () {
$.route("do/:action", { action: '', id: '' })
$.route("do/:action/:id", { action: '', id: '' })
},
"do/:action/:id route": function (obj) {
switch (obj.action) {
case 'open-campaign':
$('.content').ecm_campaign_show({ id: obj.id });
break;
}
},
"do/:action route": function (obj) {
switch (obj.action) {
case 'create-campaign':
$('.content').ecm_campaign_create();
break;
}
}
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.