client/js/renderer/scene.js
changeset 455 18b9be54174d
parent 453 04b7d46e9d67
parent 443 4c7ab16e5845
child 463 41325cc50574
child 471 e0c7be5dc02c
equal deleted inserted replaced
454:03e8815a012d 455:18b9be54174d
   336         }, 100);
   336         }, 100);
   337 
   337 
   338         _thRedrawUsers();
   338         _thRedrawUsers();
   339 
   339 
   340         // register model events
   340         // register model events
   341         this.renkan.project.on("change:save_status", function(){
   341         this.renkan.project.on("change:saveStatus", function(){
   342             switch (_this.renkan.project.get("save_status")) {
   342             switch (_this.renkan.project.get("saveStatus")) {
   343                 case 0: //clean
   343                 case 0: //clean
   344                     _this.$.find(".Rk-Save-Button").removeClass("to-save");
   344                     _this.$.find(".Rk-Save-Button").removeClass("to-save");
   345                     _this.$.find(".Rk-Save-Button").removeClass("saving");
   345                     _this.$.find(".Rk-Save-Button").removeClass("saving");
   346                     _this.$.find(".Rk-Save-Button").addClass("saved");
   346                     _this.$.find(".Rk-Save-Button").addClass("saved");
   347                     break;
   347                     break;
   356                     _this.$.find(".Rk-Save-Button").addClass("saving");
   356                     _this.$.find(".Rk-Save-Button").addClass("saving");
   357                     break;
   357                     break;
   358             }
   358             }
   359         });
   359         });
   360 
   360 
   361         this.renkan.project.on("change:loading_status", function(){
   361         this.renkan.project.on("change:loadingStatus", function(){
   362             if (_this.renkan.project.get("loading_status")){
   362             if (_this.renkan.project.get("loadingStatus")){
   363                 var animate = _this.$.find(".loader").addClass("run");
   363                 var animate = _this.$.find(".loader").addClass("run");
   364                 var timer = setTimeout(function(){
   364                 var timer = setTimeout(function(){
   365                     _this.$.find(".loader").hide(250);
   365                     _this.$.find(".loader").hide(250);
   366                 }, 3000);
   366                 }, 3000);
   367             }
   367             }
   378             }
   378             }
   379         });
   379         });
   380 
   380 
   381         this.renkan.project.on("add:nodes", function(_node) {
   381         this.renkan.project.on("add:nodes", function(_node) {
   382             _this.addRepresentation("Node", _node);
   382             _this.addRepresentation("Node", _node);
   383             if (!_this.renkan.project.get("loading_status")){
   383             if (!_this.renkan.project.get("loadingStatus")){
   384                 _thRedraw();
   384                 _thRedraw();
   385             }
   385             }
   386         });
   386         });
   387         this.renkan.project.on("add:edges", function(_edge) {
   387         this.renkan.project.on("add:edges", function(_edge) {
   388             _this.addRepresentation("Edge", _edge);
   388             _this.addRepresentation("Edge", _edge);
   389             if (!_this.renkan.project.get("loading_status")){
   389             if (!_this.renkan.project.get("loadingStatus")){
   390                 _thRedraw();
   390                 _thRedraw();
   391             }
   391             }
   392         });
   392         });
   393         this.renkan.project.on("change:title", function(_model, _title) {
   393         this.renkan.project.on("change:title", function(_model, _title) {
   394             var el = _this.$.find(".Rk-PadTitle");
   394             var el = _this.$.find(".Rk-PadTitle");
   740             return _repr;
   740             return _repr;
   741         },
   741         },
   742         addRepresentations: function(_type, _collection) {
   742         addRepresentations: function(_type, _collection) {
   743             var _this = this;
   743             var _this = this;
   744             _collection.forEach(function(_model) {
   744             _collection.forEach(function(_model) {
   745                 //_this.addRepresentation(_type, _model);
   745                 _this.addRepresentation(_type, _model);
   746             });
   746             });
   747         },
   747         },
   748         userTemplate: _.template(
   748         userTemplate: _.template(
   749                 '<li class="Rk-User"><span class="Rk-UserColor" style="background:<%=background%>;"></span><%=name%></li>'
   749                 '<li class="Rk-User"><span class="Rk-UserColor" style="background:<%=background%>;"></span><%=name%></li>'
   750         ),
   750         ),