Prevent the current mark from rerendering when the user is editing it.
This commit is contained in:
parent
26c5435b5c
commit
de405f01f1
19
www/js/ts.js
19
www/js/ts.js
@ -606,14 +606,23 @@ $(document).ready(function(){
|
|||||||
periodicRefresh: function() {
|
periodicRefresh: function() {
|
||||||
|
|
||||||
var now = new Date();
|
var now = new Date();
|
||||||
|
var models = this.entries.collection.models;
|
||||||
|
|
||||||
if (this.currentDay.getDate() != now.getDate()) {
|
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.
|
// It's a new day! Rerender our whole list.
|
||||||
this.entries.render(); }
|
else { this.entries.render(); } }
|
||||||
else {
|
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.
|
// Refresh our latest entry view so the duration is up to date.
|
||||||
var models = this.entries.collection.models;
|
else { currentModelview.render(); } } },
|
||||||
models[models.length - 1].view.render(); } },
|
|
||||||
|
|
||||||
selectTimeline: function(e) {
|
selectTimeline: function(e) {
|
||||||
if (e) {
|
if (e) {
|
||||||
@ -667,7 +676,7 @@ $(document).ready(function(){
|
|||||||
async: false,
|
async: false,
|
||||||
|
|
||||||
error: function(jqXHR, textStatus, error) {
|
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
|
// we should check that, FIXME
|
||||||
var tips = $(".validate-tips");
|
var tips = $(".validate-tips");
|
||||||
tips.text("Incorrect username/password combination.");
|
tips.text("Incorrect username/password combination.");
|
||||||
@ -719,7 +728,7 @@ $(document).ready(function(){
|
|||||||
|
|
||||||
new TS.AppView();
|
new TS.AppView();
|
||||||
|
|
||||||
})
|
});
|
||||||
|
|
||||||
function dateToJSON(d) {
|
function dateToJSON(d) {
|
||||||
function pad(n){return n<10 ? '0'+n : n}
|
function pad(n){return n<10 ? '0'+n : n}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user