client/js/router.js
author ymh <ymh.work@gmail.com>
Wed, 09 Sep 2015 18:37:15 +0200
changeset 499 7d374d366b28
parent 473 6649d2d75a87
child 510 a8f02d66bf02
permissions -rw-r--r--
Correct strange bug on fill of editor box with a difference of beavior between paperjs 0.9.23 and 0.9.24. Real cause not found, but this correction visually solve the problem

(function(root) {
    "use strict";
    
    var Backbone = root.Backbone;
    
    var Router = root.Rkns.Router = Backbone.Router.extend({
        routes: {
            '': 'index'
        },
        
        index: function (parameters) {
            
            var result = {};
            if (parameters === null){
                return;
            }
            parameters.split("&").forEach(function(part) {
              var item = part.split("=");
              result[item[0]] = decodeURIComponent(item[1]);
            });
            this.trigger('router', result);            
        }  
    });

})(window);