client/js/main.js
changeset 482 a55c33989404
parent 472 6dcff4438175
child 499 7d374d366b28
equal deleted inserted replaced
481:66c3b474a331 482:a55c33989404
    94 
    94 
    95     var Renkan = Rkns.Renkan = function(_opts) {
    95     var Renkan = Rkns.Renkan = function(_opts) {
    96         var _this = this;
    96         var _this = this;
    97 
    97 
    98         Rkns.__renkans.push(this);
    98         Rkns.__renkans.push(this);
    99         
    99 
   100         this.options = _.defaults(_opts, Rkns.defaults, {
   100         this.options = _.defaults(_opts, Rkns.defaults, {
   101             templates: renkanJST
   101             templates: _.defaults(_opts.templates, renkanJST) || renkanJST,
       
   102             node_editor_templates: _.defaults(_opts.node_editor_templates, Rkns.defaults.node_editor_templates)
   102         });
   103         });
   103         this.template = renkanJST['templates/main.html'];
   104         this.template = renkanJST['templates/main.html'];
       
   105 
       
   106         var types_templates = {};
       
   107         _.each(this.options.node_editor_templates, function(value, key) {
       
   108             types_templates[key] = _this.options.templates[value];
       
   109             delete _this.options.templates[value];
       
   110         });
       
   111         this.options.node_editor_templates = types_templates;
   104 
   112 
   105         _.each(this.options.property_files, function(f) {
   113         _.each(this.options.property_files, function(f) {
   106             Rkns.$.getJSON(f, function(data) {
   114             Rkns.$.getJSON(f, function(data) {
   107                 _this.options.properties = _this.options.properties.concat(data);
   115                 _this.options.properties = _this.options.properties.concat(data);
   108             });
   116             });