mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-25 10:27:48 +08:00
[SSE] Range protect: disable empty user's combobox when no id in event onRequestUsers.
This commit is contained in:
@ -266,6 +266,8 @@ define([
|
||||
},
|
||||
|
||||
openMenu: function(delay) {
|
||||
if (this.store.length<1) return;
|
||||
|
||||
var me = this;
|
||||
|
||||
if ( !this.scroller ) {
|
||||
|
||||
@ -45,7 +45,7 @@ if (Common.UI === undefined) {
|
||||
}
|
||||
|
||||
Common.UI.ExternalUsers = new( function() {
|
||||
var externalUsers = [],
|
||||
var externalUsers = null,
|
||||
getCallback,
|
||||
isUsersLoading = false;
|
||||
|
||||
@ -53,12 +53,12 @@ Common.UI.ExternalUsers = new( function() {
|
||||
if (isUsersLoading) return;
|
||||
|
||||
getCallback = null;
|
||||
if (externalUsers.length>0)
|
||||
callback(externalUsers);
|
||||
else {
|
||||
if (externalUsers===null) {
|
||||
getCallback = callback;
|
||||
isUsersLoading = true;
|
||||
Common.Gateway.requestUsers();
|
||||
} else {
|
||||
callback(externalUsers);
|
||||
}
|
||||
};
|
||||
|
||||
@ -72,7 +72,7 @@ Common.UI.ExternalUsers = new( function() {
|
||||
getCallback = null;
|
||||
});
|
||||
Common.NotificationCenter.on('mentions:clearusers', function() {
|
||||
externalUsers = [];
|
||||
externalUsers = null;
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@ -31,7 +31,11 @@
|
||||
cursor: default;
|
||||
background-color: @background-normal-ie;
|
||||
background-color: @background-normal;
|
||||
.user-select(none);
|
||||
.user-select(none);
|
||||
&:-ms-input-placeholder {
|
||||
color: @text-normal-ie;
|
||||
}
|
||||
.placeholder(@text-normal);
|
||||
}
|
||||
|
||||
.input-row {
|
||||
|
||||
@ -216,9 +216,14 @@ define([
|
||||
this.listUser.store.add({value: this.currentUser.id, name: this.currentUser.name + ' (' + this.textYou + ')', email: '', isCurrent: true});
|
||||
var me= this,
|
||||
rangeUsers = props.asc_getUsers();
|
||||
if (rangeUsers && rangeUsers.length>0) {
|
||||
Common.UI.ExternalUsers.get(function(users) {
|
||||
if (users && users.length>0) {
|
||||
Common.UI.ExternalUsers.get(function(users) {
|
||||
if (users && users.length>0) {
|
||||
if (!_.find(users, function(item) { return item.id!==undefined && item.id!==null; })) { // no id in user info
|
||||
me.cmbUser.setDisabled(true);
|
||||
me.cmbUser._input && me.cmbUser._input.attr('placeholder', me.txtYouCanEdit);
|
||||
}
|
||||
|
||||
if (rangeUsers && rangeUsers.length>0) {
|
||||
var store = me.listUser.store;
|
||||
rangeUsers.forEach(function(item) {
|
||||
var rec = _.findWhere(users, {id: item});
|
||||
@ -226,8 +231,11 @@ define([
|
||||
store.add({value: item, name: rec.name, email: rec.email});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
me.cmbUser.setDisabled(true);
|
||||
me.cmbUser._input && me.cmbUser._input.attr('placeholder', me.txtYouCanEdit);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user