mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-04-07 14:06:11 +08:00
feat(ruby): close editor. Fix Bug 69915
This commit is contained in:
@ -200,7 +200,8 @@ class FileModel
|
||||
feedback: true, # the Feedback & Support menu button display
|
||||
forcesave: false, # adding the request for the forced file saving to the callback handler
|
||||
submitForm: submit_form, # the Submit form button state
|
||||
goback: @user.goback.nil? ? '' : @user.goback
|
||||
goback: @user.goback.nil? ? '' : @user.goback,
|
||||
close: @user.close.nil? ? '' : @user.close
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,6 +31,7 @@ class User
|
||||
attr_accessor :templates
|
||||
attr_accessor :avatar
|
||||
attr_accessor :goback
|
||||
attr_accessor :close
|
||||
|
||||
def initialize(
|
||||
id,
|
||||
@ -45,7 +46,8 @@ class User
|
||||
descriptions,
|
||||
templates,
|
||||
avatar,
|
||||
goback
|
||||
goback,
|
||||
close
|
||||
)
|
||||
@id = id
|
||||
@name = name
|
||||
@ -60,6 +62,7 @@ class User
|
||||
@user_info_groups = user_info_groups
|
||||
@avatar = avatar
|
||||
@goback = goback
|
||||
@close = close
|
||||
end
|
||||
end
|
||||
|
||||
@ -134,7 +137,8 @@ class Users
|
||||
@descr_user_first,
|
||||
true,
|
||||
true,
|
||||
{ blank: false }
|
||||
{ blank: false },
|
||||
{ visible: false }
|
||||
),
|
||||
User.new(
|
||||
'uid-2',
|
||||
@ -153,7 +157,8 @@ class Users
|
||||
@descr_user_second,
|
||||
false,
|
||||
true,
|
||||
{ text: 'Go to Documents' }
|
||||
{ text: 'Go to Documents' },
|
||||
{}
|
||||
),
|
||||
User.new(
|
||||
'uid-3',
|
||||
@ -172,7 +177,8 @@ class Users
|
||||
@descr_user_third,
|
||||
false,
|
||||
false,
|
||||
nil
|
||||
nil,
|
||||
{}
|
||||
),
|
||||
User.new(
|
||||
'uid-0',
|
||||
@ -187,6 +193,7 @@ class Users
|
||||
@descr_user_null,
|
||||
false,
|
||||
false,
|
||||
nil,
|
||||
nil
|
||||
)
|
||||
]
|
||||
|
||||
@ -87,6 +87,11 @@
|
||||
docEditor.setActionLink(replaceActionLink(location.href, linkParam)); // set the link to the document which contains a bookmark
|
||||
};
|
||||
|
||||
var onRequestClose = function () { // close editor
|
||||
docEditor.destroyEditor();
|
||||
innerAlert("Document editor closed successfully");
|
||||
};
|
||||
|
||||
// the meta information of the document is changed via the meta command
|
||||
var onMetaChange = function (event) {
|
||||
if (event.data.favorite !== undefined) {
|
||||
@ -293,6 +298,7 @@
|
||||
|
||||
if (config.editorConfig.user.id) {
|
||||
|
||||
config.events['onRequestClose'] = onRequestClose;
|
||||
// add mentions for not anonymous users
|
||||
config.events['onRequestUsers'] = onRequestUsers;
|
||||
config.events['onRequestSaveAs'] = onRequestSaveAs;
|
||||
|
||||
Reference in New Issue
Block a user