Fix Bug 41097
This commit is contained in:
parent
f89a8674b0
commit
3adde58fde
|
@ -54,6 +54,7 @@ define([
|
|||
var storeUsers, appConfig;
|
||||
var $userList, $panelUsers, $btnUsers;
|
||||
var $saveStatus;
|
||||
var _readonlyRights = false;
|
||||
|
||||
var templateUserItem =
|
||||
'<li id="<%= user.get("iid") %>" class="<% if (!user.get("online")) { %> offline <% } if (user.get("view")) {%> viewmode <% } %>">' +
|
||||
|
@ -165,7 +166,7 @@ define([
|
|||
.removeClass('dropdown-toggle')
|
||||
.menu = false;
|
||||
|
||||
$panelUsers[(appConfig && !appConfig.isReviewOnly && appConfig.sharingSettingsUrl && appConfig.sharingSettingsUrl.length) ? 'show' : 'hide']();
|
||||
$panelUsers[(!_readonlyRights && appConfig && !appConfig.isReviewOnly && appConfig.sharingSettingsUrl && appConfig.sharingSettingsUrl.length) ? 'show' : 'hide']();
|
||||
}
|
||||
|
||||
$btnUsers.find('.caption')
|
||||
|
@ -180,6 +181,12 @@ define([
|
|||
}
|
||||
}
|
||||
|
||||
function onLostEditRights() {
|
||||
_readonlyRights = true;
|
||||
$panelUsers.find('#tlb-change-rights').hide();
|
||||
$btnUsers && !$btnUsers.menu && $panelUsers.hide();
|
||||
}
|
||||
|
||||
function onUsersClick(e) {
|
||||
if ( !$btnUsers.menu ) {
|
||||
$panelUsers.removeClass('open');
|
||||
|
@ -390,6 +397,7 @@ define([
|
|||
Common.NotificationCenter.on('app:face', function(mode) {
|
||||
Common.Utils.asyncCall(onAppShowed, me, mode);
|
||||
});
|
||||
Common.NotificationCenter.on('collaboration:sharingdeny', onLostEditRights);
|
||||
},
|
||||
|
||||
render: function (el, role) {
|
||||
|
|
|
@ -408,7 +408,7 @@ define([
|
|||
old_rights = this._state.lostEditingRights;
|
||||
this._state.lostEditingRights = !this._state.lostEditingRights;
|
||||
this.api.asc_coAuthoringDisconnect();
|
||||
this.getApplication().getController('LeftMenu').leftMenu.getMenu('file').panels['rights'].onLostEditRights();
|
||||
Common.NotificationCenter.trigger('collaboration:sharingdeny');
|
||||
Common.NotificationCenter.trigger('api:disconnect');
|
||||
if (!old_rights)
|
||||
Common.UI.warning({
|
||||
|
@ -1407,6 +1407,7 @@ define([
|
|||
}
|
||||
this._state.lostEditingRights = true;
|
||||
config.msg = this.errorUserDrop;
|
||||
Common.NotificationCenter.trigger('collaboration:sharingdeny');
|
||||
break;
|
||||
|
||||
case Asc.c_oAscError.ID.MailMergeLoadFile:
|
||||
|
|
|
@ -945,6 +945,7 @@ define([
|
|||
}
|
||||
|
||||
Common.NotificationCenter.on('collaboration:sharing', _.bind(this.changeAccessRights, this));
|
||||
Common.NotificationCenter.on('collaboration:sharingdeny', _.bind(this.onLostEditRights, this));
|
||||
|
||||
return this;
|
||||
},
|
||||
|
|
|
@ -381,7 +381,7 @@ define([
|
|||
old_rights = this._state.lostEditingRights;
|
||||
this._state.lostEditingRights = !this._state.lostEditingRights;
|
||||
this.api.asc_coAuthoringDisconnect();
|
||||
this.getApplication().getController('LeftMenu').leftMenu.getMenu('file').panels['rights'].onLostEditRights();
|
||||
Common.NotificationCenter.trigger('collaboration:sharingdeny');
|
||||
Common.NotificationCenter.trigger('api:disconnect');
|
||||
if (!old_rights)
|
||||
Common.UI.warning({
|
||||
|
@ -1140,6 +1140,7 @@ define([
|
|||
}
|
||||
this._state.lostEditingRights = true;
|
||||
config.msg = this.errorUserDrop;
|
||||
Common.NotificationCenter.trigger('collaboration:sharingdeny');
|
||||
break;
|
||||
|
||||
case Asc.c_oAscError.ID.Warning:
|
||||
|
|
|
@ -762,6 +762,7 @@ define([
|
|||
}
|
||||
|
||||
Common.NotificationCenter.on('collaboration:sharing', _.bind(this.changeAccessRights, this));
|
||||
Common.NotificationCenter.on('collaboration:sharingdeny', _.bind(this.onLostEditRights, this));
|
||||
|
||||
return this;
|
||||
},
|
||||
|
|
|
@ -404,7 +404,7 @@ define([
|
|||
old_rights = this._state.lostEditingRights;
|
||||
this._state.lostEditingRights = !this._state.lostEditingRights;
|
||||
this.api.asc_coAuthoringDisconnect();
|
||||
this.getApplication().getController('LeftMenu').leftMenu.getMenu('file').panels['rights'].onLostEditRights();
|
||||
Common.NotificationCenter.trigger('collaboration:sharingdeny');
|
||||
Common.NotificationCenter.trigger('api:disconnect');
|
||||
if (!old_rights)
|
||||
Common.UI.warning({
|
||||
|
@ -1276,6 +1276,7 @@ define([
|
|||
}
|
||||
this._state.lostEditingRights = true;
|
||||
config.msg = this.errorUserDrop;
|
||||
Common.NotificationCenter.trigger('collaboration:sharingdeny');
|
||||
break;
|
||||
|
||||
case Asc.c_oAscError.ID.InvalidReferenceOrName:
|
||||
|
|
|
@ -1217,6 +1217,7 @@ define([
|
|||
}
|
||||
|
||||
Common.NotificationCenter.on('collaboration:sharing', _.bind(this.changeAccessRights, this));
|
||||
Common.NotificationCenter.on('collaboration:sharingdeny', _.bind(this.onLostEditRights, this));
|
||||
|
||||
return this;
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue