Merge pull request #2182 from ONLYOFFICE/fix/bugfix

[DE] Fix Bug 60364, refactoring view forms mode
This commit is contained in:
Julia Radzhabova 2023-01-12 15:55:33 +03:00 committed by GitHub
commit a609494ef0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -136,10 +136,15 @@ define([
});
this.btnViewFormRoles && this.btnViewFormRoles.on('click', function (b, e) {
var item = b.menu.getChecked();
me.fireEvent('forms:mode', [b.pressed, item ? item.caption : undefined]);
if (item) {
item = item.caption;
} else if (me._state.roles && me._state.roles.length>0) {
item = me._state.roles[0].asc_getSettings().asc_getName();
}
me.fireEvent('forms:mode', [b.pressed, item]);
});
this.btnViewFormRoles.menu.on('item:toggle', _.bind(function (menu, item, state) {
if (!!state) {
this.btnViewFormRoles.menu.on('item:click', _.bind(function (menu, item) {
if (!!item.checked) {
me.btnViewFormRoles.toggle(true, true);
me.fireEvent('forms:mode', [true, item.caption]);
}