-
-
Save brendanmckenzie/2cce7c5d884d7b379b74 to your computer and use it in GitHub Desktop.
This file contains 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
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