mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-09 19:13:26 +00:00
Merge branch '3.8'
Conflicts: lib/Alchemy/Phrasea/Controller/Prod/Export.php lib/Alchemy/Phrasea/Core/Version.php lib/Alchemy/Phrasea/Helper/Prod.php lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngine.php lib/Alchemy/Phrasea/SearchEngine/SphinxSearch/SphinxSearchEngine.php lib/classes/User/Adapter.php lib/classes/caption/Field/Value.php lib/classes/collection.php lib/classes/module/report/filter.php lib/classes/task/period/ftp.php templates/web/common/dialog_export.html.twig templates/web/report/ajax_dashboard_content_child.html.twig tests/Alchemy/Tests/Phrasea/Controller/Admin/UsersTest.php
This commit is contained in:
@@ -189,12 +189,16 @@ define([
|
||||
|
||||
// get previous index if exists else next index - 1 as item is being deleted
|
||||
var index = previousIndex ? previousIndex : (nextIndex ? nextIndex - 1 : -1);
|
||||
|
||||
modalView.render();
|
||||
modalView.on("modal:confirm", function () {
|
||||
AdminFieldApp.fieldsToDelete.push(self.model);
|
||||
AdminFieldApp.fieldListView.collection.remove(self.model);
|
||||
self._selectModelView(index);
|
||||
// last item is deleted
|
||||
if (index < 0) {
|
||||
self.remove();
|
||||
} else {
|
||||
self._selectModelView(index);
|
||||
}
|
||||
// Enable state button, models is out of sync
|
||||
AdminFieldApp.saveView.updateStateButton(false);
|
||||
});
|
||||
|
@@ -28,7 +28,7 @@ define([
|
||||
this.itemViews = [];
|
||||
|
||||
// force base 1 indexed
|
||||
if (this.collection.first().get("sorter") === 0) {
|
||||
if (this.collection.length > 0 && this.collection.first().get("sorter") === 0) {
|
||||
this.collection.each(function (model) {
|
||||
model.set({'sorter': model.get("sorter") + 1}, {silent: true});
|
||||
});
|
||||
|
@@ -85,14 +85,25 @@ define([
|
||||
return this;
|
||||
},
|
||||
updateStateButton: function (disable) {
|
||||
var toDisable = disable || !this._isModelDesync();
|
||||
var toDisable = !this._isModelDesync();
|
||||
if ("undefined" !== typeof disable) {
|
||||
toDisable = disable;
|
||||
}
|
||||
|
||||
this._disableSaveButton(toDisable);
|
||||
},
|
||||
// check whether model has changed or not
|
||||
_isModelDesync: function () {
|
||||
return "undefined" !== typeof AdminFieldApp.fieldsCollection.find(function (model) {
|
||||
var fieldToDelete = false;
|
||||
var fieldToUpdate = false;
|
||||
|
||||
fieldToUpdate = "undefined" !== typeof AdminFieldApp.fieldsCollection.find(function (model) {
|
||||
return !_.isEmpty(model.previousAttributes());
|
||||
});
|
||||
|
||||
fieldToDelete = AdminFieldApp.fieldsToDelete.length > 0;
|
||||
|
||||
return fieldToUpdate || fieldToDelete;
|
||||
},
|
||||
// create a transparent overlay on top of the application
|
||||
_overlay: function (showOrHide) {
|
||||
|
Reference in New Issue
Block a user