client/js/router.js
author ymh <ymh.work@gmail.com>
Thu, 05 Jan 2017 19:34:53 +0100
changeset 648 e388117572d8
parent 510 a8f02d66bf02
permissions -rw-r--r--
Improve display of editor tooltip. Add a vertical scroll if they too tall.

(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){
                parameters.split("&").forEach(function(part) {
                    var item = part.split("=");
                    result[item[0]] = decodeURIComponent(item[1]);
                });
            }
            this.trigger('router', result);        
        }  
    });

})(window);