secret
Created

  • Download Gist
gistfile1.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
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;
}
}
})
});

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.