Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ONLYOFFICE/onlyoffice-nextcloud.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorSergey Linnik <sergey.linnik@onlyoffice.com>2018-07-31 17:11:53 +0300
committerSergey Linnik <sergey.linnik@onlyoffice.com>2018-08-01 14:52:17 +0300
commit17d48808caf56389169580859d3558af01d490c5 (patch)
tree97b587edce9666f059d3530caf85b4e532aa7afd /js
parentb0354e5ee4f4dbc219226bab7a246835a5567e25 (diff)
remove confirmation dialog
Diffstat (limited to 'js')
-rw-r--r--js/main.js45
1 files changed, 18 insertions, 27 deletions
diff --git a/js/main.js b/js/main.js
index 8bc9477..9d774f4 100644
--- a/js/main.js
+++ b/js/main.js
@@ -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);
});
};