| author | rougeronj |
| Fri, 05 Jun 2015 12:17:16 +0200 | |
| changeset 472 | 6dcff4438175 |
| parent 471 | e0c7be5dc02c |
| child 473 | 6649d2d75a87 |
| permissions | -rw-r--r-- |
(function(root) { "use strict"; var Backbone = root.Backbone; var Router = root.Rkns.Router = Backbone.Router.extend({ routes: { '': 'index', '*params': 'setParams' }, index: function(){ this.params = {}; }, setParams: function (parameters) { var _this = this; this.params = {}; parameters.split('&').forEach(function(param){ _this.params[param.split('=')[0]] = param.split('=')[1] || null; _this.trigger(param.split('=')[0], param.split('=')[1]); }); } }); })(window);