mirror of
https://github.com/espocrm/espocrm.git
synced 2026-07-01 08:26:04 +00:00
fix record next/prev
This commit is contained in:
@@ -394,14 +394,13 @@ Espo.define('views/modals/detail', 'views/modal', function (Dep) {
|
||||
} else {
|
||||
var initialCount = collection.length;
|
||||
|
||||
this.listenToOnce(collection, 'sync', function () {
|
||||
var model = collection.at(indexOfRecord);
|
||||
this.switchToModelByIndex(indexOfRecord);
|
||||
}, this);
|
||||
collection.fetch({
|
||||
more: true,
|
||||
remove: false,
|
||||
});
|
||||
}).then(function () {
|
||||
var model = collection.at(indexOfRecord);
|
||||
this.switchToModelByIndex(indexOfRecord);
|
||||
}.bind(this));
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -975,6 +975,8 @@ define('views/record/detail', ['views/record/base', 'view-record-helper'], funct
|
||||
},
|
||||
|
||||
actionPrevious: function () {
|
||||
this.model.abortLastFetch();
|
||||
|
||||
var collection;
|
||||
if (!this.model.collection) {
|
||||
collection = this.collection;
|
||||
@@ -992,6 +994,8 @@ define('views/record/detail', ['views/record/base', 'view-record-helper'], funct
|
||||
},
|
||||
|
||||
actionNext: function () {
|
||||
this.model.abortLastFetch();
|
||||
|
||||
var collection;
|
||||
if (!this.model.collection) {
|
||||
collection = this.collection;
|
||||
@@ -1011,14 +1015,13 @@ define('views/record/detail', ['views/record/base', 'view-record-helper'], funct
|
||||
} else {
|
||||
var initialCount = collection.length;
|
||||
|
||||
this.listenToOnce(collection, 'sync', function () {
|
||||
var model = collection.at(indexOfRecord);
|
||||
this.switchToModelByIndex(indexOfRecord);
|
||||
}, this);
|
||||
collection.fetch({
|
||||
more: true,
|
||||
remove: false,
|
||||
});
|
||||
}).then(function () {
|
||||
var model = collection.at(indexOfRecord);
|
||||
this.switchToModelByIndex(indexOfRecord);
|
||||
}.bind(this));
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user