mirror of
https://github.com/ONLYOFFICE/sdkjs.git
synced 2026-02-10 18:15:19 +08:00
[oform] Add ability to set NoRole as a current role
This commit is contained in:
@ -40,8 +40,9 @@
|
||||
*/
|
||||
function CRestrictionSettings()
|
||||
{
|
||||
this.OFormRole = undefined;
|
||||
this.ResetNone = false;
|
||||
this.OFormRole = undefined;
|
||||
this.OFormNoRole = false;
|
||||
this.ResetNone = false;
|
||||
}
|
||||
CRestrictionSettings.prototype.GetOFormRole = function()
|
||||
{
|
||||
@ -51,12 +52,22 @@
|
||||
{
|
||||
this.OFormRole = roleName;
|
||||
};
|
||||
CRestrictionSettings.prototype.IsOFormNoRole = function()
|
||||
{
|
||||
return this.OFormNoRole;
|
||||
};
|
||||
CRestrictionSettings.prototype.SetOFormNoRole = function(noRole)
|
||||
{
|
||||
this.OFormNoRole = noRole;
|
||||
};
|
||||
//--------------------------------------------------------export----------------------------------------------------
|
||||
window['AscCommon'] = window['AscCommon'] || {};
|
||||
window['AscCommon'].CRestrictionSettings = CRestrictionSettings;
|
||||
window['AscCommon']["CRestrictionSettings"] = CRestrictionSettings;
|
||||
|
||||
CRestrictionSettings.prototype['get_OFormRole'] = CRestrictionSettings.prototype.GetOFormRole;
|
||||
CRestrictionSettings.prototype['put_OFormRole'] = CRestrictionSettings.prototype.SetOFormRole;
|
||||
CRestrictionSettings.prototype['get_OFormRole'] = CRestrictionSettings.prototype.GetOFormRole;
|
||||
CRestrictionSettings.prototype['put_OFormRole'] = CRestrictionSettings.prototype.SetOFormRole;
|
||||
CRestrictionSettings.prototype['get_OFormNoRole'] = CRestrictionSettings.prototype.IsOFormNoRole;
|
||||
CRestrictionSettings.prototype['put_OFormNoRole'] = CRestrictionSettings.prototype.SetOFormNoRole;
|
||||
|
||||
})(window);
|
||||
|
||||
@ -13709,7 +13709,10 @@ background-repeat: no-repeat;\
|
||||
if (oform)
|
||||
{
|
||||
let roleName = restrictionSettings ? restrictionSettings.GetOFormRole() : null;
|
||||
if (oLogicDocument.IsFillingFormMode() && roleName)
|
||||
|
||||
if (oLogicDocument.IsFillingFormMode() && restrictionSettings && restrictionSettings.IsOFormNoRole())
|
||||
oform.setCurrentNoRole();
|
||||
else if (oLogicDocument.IsFillingFormMode() && roleName)
|
||||
oform.setCurrentRole(roleName);
|
||||
else
|
||||
oform.clearCurrentRole();
|
||||
|
||||
Reference in New Issue
Block a user