[DE] refactoring
This commit is contained in:
parent
181bdc7fa2
commit
5ed32d082c
|
@ -292,7 +292,7 @@ define([
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
storeUsers = DE.getCollection('Common.Collections.Users')
|
storeUsers = this.options.storeUsers;
|
||||||
storeUsers.bind({
|
storeUsers.bind({
|
||||||
add : onAddUser,
|
add : onAddUser,
|
||||||
change : onUsersChanged,
|
change : onUsersChanged,
|
||||||
|
|
|
@ -154,7 +154,6 @@ define([
|
||||||
var _icon_url = model.get('baseUrl') + modes[model.get('currentVariation')].get('icons')[(window.devicePixelRatio > 1) ? 1 : 0];
|
var _icon_url = model.get('baseUrl') + modes[model.get('currentVariation')].get('icons')[(window.devicePixelRatio > 1) ? 1 : 0];
|
||||||
var btn = new Common.UI.Button({
|
var btn = new Common.UI.Button({
|
||||||
cls: 'btn-toolbar x-huge icon-top',
|
cls: 'btn-toolbar x-huge icon-top',
|
||||||
iconCls: 'img-commonctrl review-prev',
|
|
||||||
iconImg: _icon_url,
|
iconImg: _icon_url,
|
||||||
caption: model.get('name'),
|
caption: model.get('name'),
|
||||||
menu: modes && modes.length > 1,
|
menu: modes && modes.length > 1,
|
||||||
|
|
|
@ -104,9 +104,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.button-otherstates-icon2(@icon-class, @icon-size) {
|
.button-otherstates-icon2(@icon-class, @icon-size) {
|
||||||
button.@{icon-class}.active > .icon,
|
button.@{icon-class}.active .icon,
|
||||||
button.@{icon-class}:active > .icon {background-position-x: -1*@icon-size; --bgX: -(1*@icon-size);}
|
button.@{icon-class}:active .icon {background-position-x: -1*@icon-size; --bgX: -(1*@icon-size);}
|
||||||
button.@{icon-class}.disabled > .icon {background-position-x: -2*@icon-size; --bgX: -(2*@icon-size);}
|
button.@{icon-class}.disabled .icon {background-position-x: -2*@icon-size; --bgX: -(2*@icon-size);}
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-icon-normal(@icon-class, @index, @icon-size) {
|
.menu-icon-normal(@icon-class, @index, @icon-size) {
|
||||||
|
|
|
@ -997,14 +997,14 @@ define([
|
||||||
this.appOptions.canCoAuthoring = !this.appOptions.isLightVersion;
|
this.appOptions.canCoAuthoring = !this.appOptions.isLightVersion;
|
||||||
/** coauthoring end **/
|
/** coauthoring end **/
|
||||||
this.appOptions.isOffline = this.api.asc_isOffline();
|
this.appOptions.isOffline = this.api.asc_isOffline();
|
||||||
this.appOptions.isReviewOnly = (this.permissions.review === true) && (this.permissions.edit === false);
|
|
||||||
this.appOptions.canRequestEditRights = this.editorConfig.canRequestEditRights;
|
this.appOptions.canRequestEditRights = this.editorConfig.canRequestEditRights;
|
||||||
this.appOptions.canEdit = (this.permissions.edit !== false || this.permissions.review === true) && // can edit or review
|
this.appOptions.canEdit = (this.permissions.edit !== false || this.permissions.review === true) && // can edit or review
|
||||||
(this.editorConfig.canRequestEditRights || this.editorConfig.mode !== 'view') && // if mode=="view" -> canRequestEditRights must be defined
|
(this.editorConfig.canRequestEditRights || this.editorConfig.mode !== 'view') && // if mode=="view" -> canRequestEditRights must be defined
|
||||||
(!this.appOptions.isReviewOnly || this.appOptions.canLicense); // if isReviewOnly==true -> canLicense must be true
|
(!this.appOptions.isReviewOnly || this.appOptions.canLicense); // if isReviewOnly==true -> canLicense must be true
|
||||||
this.appOptions.isEdit = this.appOptions.canLicense && this.appOptions.canEdit && this.editorConfig.mode !== 'view';
|
this.appOptions.isEdit = this.appOptions.canLicense && this.appOptions.canEdit && this.editorConfig.mode !== 'view';
|
||||||
this.appOptions.canReview = this.appOptions.canLicense && this.appOptions.isEdit && (this.permissions.review===true);
|
this.appOptions.canReview = this.permissions.review === true && this.appOptions.canLicense && this.appOptions.isEdit;
|
||||||
this.appOptions.canUseHistory = this.appOptions.canLicense && !this.appOptions.isLightVersion && this.editorConfig.canUseHistory && this.appOptions.canCoAuthoring && !this.appOptions.isDesktopApp;
|
this.appOptions.isReviewOnly = this.permissions.review === true && this.permissions.edit === false;
|
||||||
|
this.appOptions.canUseHistory = this.appOptions.canLicense && this.editorConfig.canUseHistory && this.appOptions.canCoAuthoring && !this.appOptions.isDesktopApp;
|
||||||
this.appOptions.canHistoryClose = this.editorConfig.canHistoryClose;
|
this.appOptions.canHistoryClose = this.editorConfig.canHistoryClose;
|
||||||
this.appOptions.canHistoryRestore= this.editorConfig.canHistoryRestore && !!this.permissions.changeHistory;
|
this.appOptions.canHistoryRestore= this.editorConfig.canHistoryRestore && !!this.permissions.changeHistory;
|
||||||
this.appOptions.canUseMailMerge= this.appOptions.canLicense && this.appOptions.canEdit && !this.appOptions.isDesktopApp;
|
this.appOptions.canUseMailMerge= this.appOptions.canLicense && this.appOptions.canEdit && !this.appOptions.isDesktopApp;
|
||||||
|
@ -1016,6 +1016,17 @@ define([
|
||||||
this.appOptions.canRename = !!this.permissions.rename;
|
this.appOptions.canRename = !!this.permissions.rename;
|
||||||
this.appOptions.buildVersion = params.asc_getBuildVersion();
|
this.appOptions.buildVersion = params.asc_getBuildVersion();
|
||||||
|
|
||||||
|
if ( this.appOptions.isLightVersion ) {
|
||||||
|
this.appOptions.canUseHistory =
|
||||||
|
this.appOptions.canReview =
|
||||||
|
this.appOptions.isReviewOnly = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !this.appOptions.canCoAuthoring ) {
|
||||||
|
this.appOptions.canChat =
|
||||||
|
this.appOptions.canComments = false;
|
||||||
|
}
|
||||||
|
|
||||||
var type = /^(?:(pdf|djvu|xps))$/.exec(this.document.fileType);
|
var type = /^(?:(pdf|djvu|xps))$/.exec(this.document.fileType);
|
||||||
this.appOptions.canDownloadOrigin = !this.appOptions.nativeApp && this.permissions.download !== false && (type && typeof type[1] === 'string');
|
this.appOptions.canDownloadOrigin = !this.appOptions.nativeApp && this.permissions.download !== false && (type && typeof type[1] === 'string');
|
||||||
this.appOptions.canDownload = !this.appOptions.nativeApp && this.permissions.download !== false && (!type || typeof type[1] !== 'string');
|
this.appOptions.canDownload = !this.appOptions.nativeApp && this.permissions.download !== false && (!type || typeof type[1] !== 'string');
|
||||||
|
|
|
@ -93,7 +93,8 @@ define([
|
||||||
// Create and render main view
|
// Create and render main view
|
||||||
this.viewport = this.createView('Viewport').render();
|
this.viewport = this.createView('Viewport').render();
|
||||||
this.header = this.createView('Common.Views.Header', {
|
this.header = this.createView('Common.Views.Header', {
|
||||||
headerCaption: 'Document Editor'
|
headerCaption: 'Document Editor',
|
||||||
|
storeUsers: DE.getCollection('Common.Collections.Users')
|
||||||
});
|
});
|
||||||
|
|
||||||
Common.NotificationCenter.on('layout:changed', _.bind(this.onLayoutChanged, this));
|
Common.NotificationCenter.on('layout:changed', _.bind(this.onLayoutChanged, this));
|
||||||
|
|
|
@ -67,7 +67,7 @@ define([
|
||||||
}
|
}
|
||||||
|
|
||||||
function _clickLanguage(menu, item, state) {
|
function _clickLanguage(menu, item, state) {
|
||||||
var $parent = $(menu.el.parentNode, this.$el);
|
var $parent = menu.$el.parent();
|
||||||
|
|
||||||
$parent.find('#status-label-lang').text(item.caption);
|
$parent.find('#status-label-lang').text(item.caption);
|
||||||
$parent.find('.icon-lang-flag')
|
$parent.find('.icon-lang-flag')
|
||||||
|
|
Loading…
Reference in a new issue