Pass fixGaps to Zotero.Search.save() in an options object
This commit is contained in:
parent
e02945b591
commit
f7220378dd
|
@ -232,7 +232,7 @@
|
||||||
<body>
|
<body>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
this.updateSearch();
|
this.updateSearch();
|
||||||
return this.search.save(true);
|
return this.search.save({fixGaps: true});
|
||||||
]]>
|
]]>
|
||||||
</body>
|
</body>
|
||||||
</method>
|
</method>
|
||||||
|
|
|
@ -445,7 +445,6 @@ Zotero.DataObject.prototype.editCheck = function () {
|
||||||
*/
|
*/
|
||||||
Zotero.DataObject.prototype.save = Zotero.Promise.coroutine(function* (options) {
|
Zotero.DataObject.prototype.save = Zotero.Promise.coroutine(function* (options) {
|
||||||
var env = {
|
var env = {
|
||||||
arguments: arguments,
|
|
||||||
transactionOptions: null,
|
transactionOptions: null,
|
||||||
options: options || {}
|
options: options || {}
|
||||||
};
|
};
|
||||||
|
|
|
@ -181,17 +181,8 @@ Zotero.Search.prototype._initSave = Zotero.Promise.coroutine(function* (env) {
|
||||||
return Zotero.Search._super.prototype._initSave.apply(this, arguments);
|
return Zotero.Search._super.prototype._initSave.apply(this, arguments);
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
|
||||||
* Save the search to the DB and return a savedSearchID
|
|
||||||
*
|
|
||||||
* If there are gaps in the searchConditionIDs, |fixGaps| must be true
|
|
||||||
* and the caller must dispose of the search or reload the condition ids,
|
|
||||||
* which may change after the save.
|
|
||||||
*
|
|
||||||
* For new searches, name must be set called before saving
|
|
||||||
*/
|
|
||||||
Zotero.Search.prototype._saveData = Zotero.Promise.coroutine(function* (env) {
|
Zotero.Search.prototype._saveData = Zotero.Promise.coroutine(function* (env) {
|
||||||
var fixGaps = env.arguments[0];
|
var fixGaps = env.options.fixGaps;
|
||||||
var isNew = env.isNew;
|
var isNew = env.isNew;
|
||||||
|
|
||||||
var searchID = env.id = this._id = this.id ? this.id : yield Zotero.ID.get('savedSearches');
|
var searchID = env.id = this._id = this.id ? this.id : yield Zotero.ID.get('savedSearches');
|
||||||
|
|
Loading…
Reference in New Issue
Block a user