[IMP] website_slides: upload document doesn't rewrite title everytime

Before when you uploaded a document, the title was set to the filename even when the field was
set by the user before. Now, the field title is set to the filename only when it is
empty.

task-2161391
This commit is contained in:
Jérémy Hennecart
2020-02-12 12:55:35 +00:00
parent c9ace27135
commit 68dd11b6f2
@@ -516,7 +516,9 @@ var SlideUploadDialog = Dialog.extend({
if (!preventOnchange) {
var input = file.name;
var inputVal = input.substr(0, input.lastIndexOf('.')) || input;
this._formSetFieldValue('name', inputVal);
if (this._formGetFieldValue('name') === "") {
this._formSetFieldValue('name', inputVal);
}
}
},
_onChangeSlideUrl: function (ev) {