Prevent the current mark from rerendering when the user is editing it.

This commit is contained in:
Jonathan Bernard 2013-11-04 03:55:41 +00:00
parent 26c5435b5c
commit de405f01f1

View File

@ -606,14 +606,23 @@ $(document).ready(function(){
periodicRefresh: function() {
var now = new Date();
var models = this.entries.collection.models;
if (this.currentDay.getDate() != now.getDate()) {
// If the user is editing any one of the models, don't rerender
if (_.any(models, function(model) {
return $(model.view.el).hasClass('editing') })) {
return }
// It's a new day! Rerender our whole list.
this.entries.render(); }
else { this.entries.render(); } }
else {
var currentModel = models[models.length - 1]
if ($(currentModel.view.el).hasClass('editing')) { return }
// Refresh our latest entry view so the duration is up to date.
var models = this.entries.collection.models;
models[models.length - 1].view.render(); } },
else { currentModelview.render(); } } },
selectTimeline: function(e) {
if (e) {
@ -667,7 +676,7 @@ $(document).ready(function(){
async: false,
error: function(jqXHR, textStatus, error) {
// assuming bad credentials (possible server error or bad request,
// assuming bad credentials (possible server error or bad request),
// we should check that, FIXME
var tips = $(".validate-tips");
tips.text("Incorrect username/password combination.");
@ -719,7 +728,7 @@ $(document).ready(function(){
new TS.AppView();
})
});
function dateToJSON(d) {
function pad(n){return n<10 ? '0'+n : n}