diff options
author | Sergey Linnik <sergey.linnik@onlyoffice.com> | 2018-07-31 17:11:53 +0300 |
---|---|---|
committer | Sergey Linnik <sergey.linnik@onlyoffice.com> | 2018-08-01 14:52:17 +0300 |
commit | 17d48808caf56389169580859d3558af01d490c5 (patch) | |
tree | 97b587edce9666f059d3530caf85b4e532aa7afd /js | |
parent | b0354e5ee4f4dbc219226bab7a246835a5567e25 (diff) |
remove confirmation dialog
Diffstat (limited to 'js')
-rw-r--r-- | js/main.js | 45 |
1 files changed, 18 insertions, 27 deletions
@@ -104,36 +104,27 @@ var fileInfoModel = context.fileInfoModel || context.fileList.getModelForFile(fileName); var fileList = context.fileList; - OC.dialogs.confirm(t(OCA.Onlyoffice.AppName, "The document file you open will be converted to the Office Open XML format for faster viewing and editing."), - t(OCA.Onlyoffice.AppName, "Convert and open document"), - function (convert) { - if (!convert) { - OCA.Onlyoffice.OpenEditor(fileInfoModel.id); + $.post(OC.generateUrl("apps/" + OCA.Onlyoffice.AppName + "/ajax/convert"), + { + fileId: fileInfoModel.id + }, + function onSuccess(response) { + if (response.error) { + var row = OC.Notification.show(response.error); + setTimeout(function () { + OC.Notification.hide(row); + }, 3000); return; } - $.post(OC.generateUrl("apps/" + OCA.Onlyoffice.AppName + "/ajax/convert"), - { - fileId: fileInfoModel.id - }, - function onSuccess(response) { - if (response.error) { - var row = OC.Notification.show(response.error); - setTimeout(function () { - OC.Notification.hide(row); - }, 3000); - return; - } - - if (response.parentId == fileList.dirInfo.id) { - fileList.add(response, { animate: true }); - } - - var row = OC.Notification.show(t(OCA.Onlyoffice.AppName, "File created")); - setTimeout(function () { - OC.Notification.hide(row); - }, 3000); - }); + if (response.parentId == fileList.dirInfo.id) { + fileList.add(response, { animate: true }); + } + + var row = OC.Notification.show(t(OCA.Onlyoffice.AppName, "File created")); + setTimeout(function () { + OC.Notification.hide(row); + }, 3000); }); }; |