Merge branch 'develop' into feature/refactor
This commit is contained in:
commit
f5fb3f94f5
|
@ -186,6 +186,16 @@ function getParent($this) {
|
|||
return $parent && $parent.length ? $parent : $this.parent();
|
||||
}
|
||||
|
||||
function clearMenus() {
|
||||
$('.dropdown-toggle').each(function (e) {
|
||||
var $parent = ($(this)).parent();
|
||||
if (!$parent.hasClass('open')) return;
|
||||
$parent.trigger(e = $.Event('hide.bs.dropdown'));
|
||||
if (e.isDefaultPrevented()) return;
|
||||
$parent.removeClass('open').trigger('hidden.bs.dropdown');
|
||||
})
|
||||
}
|
||||
|
||||
$(document)
|
||||
.off('keydown.bs.dropdown.data-api')
|
||||
.on('keydown.bs.dropdown.data-api', '[data-toggle=dropdown], [role=menu]' , onDropDownKeyDown);
|
||||
|
@ -206,9 +216,8 @@ $(document)
|
|||
}
|
||||
|
||||
function onDropDownClick(e) {
|
||||
if ((e.which == 1 || e.which == undefined) && !!clickDefHandler) {
|
||||
clickDefHandler(e);
|
||||
}
|
||||
if (e.which == 1 || e.which == undefined)
|
||||
clearMenus();
|
||||
}
|
||||
|
||||
if (!!clickDefHandler) {
|
||||
|
|
|
@ -423,39 +423,41 @@ define([
|
|||
|
||||
var changes = version.changes, change, i;
|
||||
if (changes && changes.length>0) {
|
||||
arrVersions[arrVersions.length-1].set('changeid', changes.length-1);
|
||||
arrVersions[arrVersions.length-1].set('docIdPrev', docIdPrev);
|
||||
arrVersions[arrVersions.length-1].set('hasChanges', changes.length>1);
|
||||
for (i=changes.length-2; i>=0; i--) {
|
||||
change = changes[i];
|
||||
if (!_.isEmpty(version.serverVersion) && version.serverVersion == this.appOptions.buildVersion) {
|
||||
arrVersions[arrVersions.length-1].set('changeid', changes.length-1);
|
||||
arrVersions[arrVersions.length-1].set('hasChanges', changes.length>1);
|
||||
for (i=changes.length-2; i>=0; i--) {
|
||||
change = changes[i];
|
||||
|
||||
user = usersStore.findUser(change.user.id);
|
||||
if (!user) {
|
||||
user = new Common.Models.User({
|
||||
id : change.user.id,
|
||||
username : change.user.name,
|
||||
colorval : Asc.c_oAscArrUserColors[usersCnt],
|
||||
color : this.generateUserColor(Asc.c_oAscArrUserColors[usersCnt++])
|
||||
});
|
||||
usersStore.add(user);
|
||||
user = usersStore.findUser(change.user.id);
|
||||
if (!user) {
|
||||
user = new Common.Models.User({
|
||||
id : change.user.id,
|
||||
username : change.user.name,
|
||||
colorval : Asc.c_oAscArrUserColors[usersCnt],
|
||||
color : this.generateUserColor(Asc.c_oAscArrUserColors[usersCnt++])
|
||||
});
|
||||
usersStore.add(user);
|
||||
}
|
||||
|
||||
arrVersions.push(new Common.Models.HistoryVersion({
|
||||
version: version.versionGroup,
|
||||
revision: version.version,
|
||||
changeid: i,
|
||||
userid : change.user.id,
|
||||
username : change.user.name,
|
||||
usercolor: user.get('color'),
|
||||
created: change.created,
|
||||
docId: version.key,
|
||||
docIdPrev: docIdPrev,
|
||||
selected: false,
|
||||
canRestore: this.appOptions.canHistoryRestore,
|
||||
isRevision: false,
|
||||
isVisible: true
|
||||
}));
|
||||
arrColors.push(user.get('colorval'));
|
||||
}
|
||||
|
||||
arrVersions.push(new Common.Models.HistoryVersion({
|
||||
version: version.versionGroup,
|
||||
revision: version.version,
|
||||
changeid: i,
|
||||
userid : change.user.id,
|
||||
username : change.user.name,
|
||||
usercolor: user.get('color'),
|
||||
created: change.created,
|
||||
docId: version.key,
|
||||
docIdPrev: docIdPrev,
|
||||
selected: false,
|
||||
canRestore: this.appOptions.canHistoryRestore,
|
||||
isRevision: false,
|
||||
isVisible: true
|
||||
}));
|
||||
arrColors.push(user.get('colorval'));
|
||||
}
|
||||
} else if (ver==0 && versions.length==1) {
|
||||
arrVersions[arrVersions.length-1].set('docId', version.key + '1');
|
||||
|
@ -954,6 +956,10 @@ define([
|
|||
}
|
||||
|
||||
this.permissions.review = (this.permissions.review === undefined) ? (this.permissions.edit !== false) : this.permissions.review;
|
||||
|
||||
if (params.asc_getRights() !== Asc.c_oRights.Edit)
|
||||
this.permissions.edit = this.permissions.review = false;
|
||||
|
||||
this.appOptions.canAnalytics = params.asc_getIsAnalyticsEnable();
|
||||
this.appOptions.canLicense = (licType === Asc.c_oLicenseResult.Success);
|
||||
this.appOptions.isLightVersion = params.asc_getIsLight();
|
||||
|
@ -978,6 +984,7 @@ define([
|
|||
this.appOptions.canEditStyles = this.appOptions.canLicense && this.appOptions.canEdit;
|
||||
this.appOptions.canPrint = (this.permissions.print !== false);
|
||||
this.appOptions.canRename = !!this.permissions.rename;
|
||||
this.appOptions.buildVersion = params.asc_getBuildVersion();
|
||||
|
||||
var type = /^(?:(pdf|djvu|xps))$/.exec(this.document.fileType);
|
||||
this.appOptions.canDownloadOrigin = !this.appOptions.nativeApp && this.permissions.download !== false && (type && typeof type[1] === 'string');
|
||||
|
|
|
@ -167,14 +167,15 @@ define([
|
|||
this._settings[Common.Utils.documentSettingsType.MailMerge].locked = !can_add_table || in_equation;
|
||||
}
|
||||
|
||||
var lastactive = -1, currentactive, priorityactive = -1;
|
||||
var lastactive = -1, currentactive, priorityactive = -1,
|
||||
activePane = this.rightmenu.GetActivePane();
|
||||
for (i=0; i<this._settings.length; i++) {
|
||||
var pnl = this._settings[i];
|
||||
if (pnl===undefined || pnl.btn===undefined || pnl.panel===undefined) continue;
|
||||
|
||||
if ( pnl.hidden ) {
|
||||
if (!pnl.btn.isDisabled()) pnl.btn.setDisabled(true);
|
||||
if (this.rightmenu.GetActivePane() == pnl.panelId)
|
||||
if (activePane == pnl.panelId)
|
||||
currentactive = -1;
|
||||
} else {
|
||||
if (pnl.btn.isDisabled()) pnl.btn.setDisabled(false);
|
||||
|
@ -182,7 +183,7 @@ define([
|
|||
if ( pnl.needShow ) {
|
||||
pnl.needShow = false;
|
||||
priorityactive = i;
|
||||
} else if (this.rightmenu.GetActivePane() == pnl.panelId)
|
||||
} else if (activePane == pnl.panelId)
|
||||
currentactive = i;
|
||||
pnl.panel.setLocked(pnl.locked);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
<div class="statusbar" style="display:table;">
|
||||
<div class="status-group dropup">
|
||||
<label id="label-pages" class="status-label" style="margin-left: 40px;" data-toggle="dropdown"><%= Common.Utils.String.format(scope.pageIndexText, 1, 1) %></label>
|
||||
<label id="label-pages" class="status-label dropdown-toggle" style="margin-left: 40px;" data-toggle="dropdown"><%= Common.Utils.String.format(scope.pageIndexText, 1, 1) %></label>
|
||||
<div id="status-goto-box" class="dropdown-menu">
|
||||
<label style="float:left;line-height:22px;"><%= scope.goToPageText %></label>
|
||||
<div id="status-goto-page" style="display:inline-block;"></div>
|
||||
|
|
|
@ -258,7 +258,7 @@ define([
|
|||
this._settings[type].btn.toggle(true, false);
|
||||
this._settings[type].btn.trigger('click', this._settings[type].btn);
|
||||
} else {
|
||||
var target_pane = $("#" + this._settings[type].panel );
|
||||
var target_pane = this.$el.find("#" + this._settings[type].panel );
|
||||
if ( !target_pane.hasClass('active') ) {
|
||||
target_pane.parent().find('> .active').removeClass('active');
|
||||
target_pane.addClass("active");
|
||||
|
@ -271,7 +271,7 @@ define([
|
|||
},
|
||||
|
||||
GetActivePane: function() {
|
||||
return (this.minimizedMode) ? null : $(".settings-panel.active")[0].id;
|
||||
return (this.minimizedMode) ? null : this.$el.find(".settings-panel.active")[0].id;
|
||||
},
|
||||
|
||||
clearSelection: function() {
|
||||
|
|
|
@ -417,6 +417,7 @@ define([
|
|||
usertip.setContent();
|
||||
}
|
||||
(length > 1) ? this.panelUsersBlock.attr('data-toggle', 'dropdown') : this.panelUsersBlock.removeAttr('data-toggle');
|
||||
this.panelUsersBlock.toggleClass('dropdown-toggle', length > 1);
|
||||
(length > 1) ? this.panelUsersBlock.off('click') : this.panelUsersBlock.on('click', _.bind(this.onUsersClick, this));
|
||||
},
|
||||
|
||||
|
|
|
@ -733,6 +733,9 @@ define([
|
|||
return;
|
||||
}
|
||||
|
||||
if (params.asc_getRights() !== Asc.c_oRights.Edit)
|
||||
this.permissions.edit = false;
|
||||
|
||||
this.appOptions.isOffline = this.api.asc_isOffline();
|
||||
this.appOptions.canLicense = (licType === Asc.c_oLicenseResult.Success);
|
||||
this.appOptions.isLightVersion = params.asc_getIsLight();
|
||||
|
|
|
@ -148,14 +148,15 @@ define([
|
|||
}
|
||||
}
|
||||
|
||||
var lastactive = -1, currentactive, priorityactive = -1;
|
||||
var lastactive = -1, currentactive, priorityactive = -1,
|
||||
activePane = this.rightmenu.GetActivePane();
|
||||
for (i=0; i<this._settings.length; i++) {
|
||||
var pnl = this._settings[i];
|
||||
if (pnl===undefined) continue;
|
||||
|
||||
if ( pnl.hidden ) {
|
||||
if (!pnl.btn.isDisabled()) pnl.btn.setDisabled(true);
|
||||
if (this.rightmenu.GetActivePane() == pnl.panelId)
|
||||
if (activePane == pnl.panelId)
|
||||
currentactive = -1;
|
||||
} else {
|
||||
if (pnl.btn.isDisabled()) pnl.btn.setDisabled(false);
|
||||
|
@ -165,7 +166,7 @@ define([
|
|||
pnl.needShow = false;
|
||||
priorityactive = i;
|
||||
} else if ( i != Common.Utils.documentSettingsType.Slide || this.rightmenu._settings[i].isCurrent) {
|
||||
if (this.rightmenu.GetActivePane() == pnl.panelId)
|
||||
if (activePane == pnl.panelId)
|
||||
currentactive = i;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="statusbar" style="display:table;">
|
||||
<div class="status-group dropup">
|
||||
<button id="status-btn-preview" type="button" class="btn small btn-toolbar" style="margin-left: 9px;"><span class="btn-icon"> </span></button>
|
||||
<label id="status-label-pages" class="status-label" style="margin-left: 7px;" data-toggle="dropdown"><%= Common.Utils.String.format(scope.pageIndexText, 1, 1) %></label>
|
||||
<label id="status-label-pages" class="status-label dropdown-toggle" style="margin-left: 7px;" data-toggle="dropdown"><%= Common.Utils.String.format(scope.pageIndexText, 1, 1) %></label>
|
||||
<div id="status-goto-box" class="dropdown-menu">
|
||||
<label style="float:left;line-height:22px;"><%= scope.goToPageText %></label>
|
||||
<div id="status-goto-page" style="display:inline-block;"></div>
|
||||
|
|
|
@ -78,7 +78,7 @@ define([
|
|||
'<div class="separator"/>',
|
||||
'</div>',
|
||||
'<div class="preview-group dropup">',
|
||||
'<label id="preview-label-slides" class="status-label" data-toggle="dropdown">Slide 1 of 1</label>',
|
||||
'<label id="preview-label-slides" class="status-label dropdown-toggle" data-toggle="dropdown">Slide 1 of 1</label>',
|
||||
'<div id="preview-goto-box" class="dropdown-menu">',
|
||||
'<label style="float:left;line-height:22px;">' + this.goToSlideText + '</label>',
|
||||
'<div id="preview-goto-page" style="display:inline-block;"></div>',
|
||||
|
|
|
@ -254,7 +254,7 @@ define([
|
|||
},
|
||||
|
||||
GetActivePane: function() {
|
||||
return (this.minimizedMode) ? null : $(".settings-panel.active")[0].id;
|
||||
return (this.minimizedMode) ? null : this.$el.find(".settings-panel.active")[0].id;
|
||||
},
|
||||
|
||||
SetDisabled: function(id, disabled, all) {
|
||||
|
|
|
@ -321,6 +321,7 @@ define([
|
|||
usertip.setContent();
|
||||
}
|
||||
(length > 1) ? this.panelUsersBlock.attr('data-toggle', 'dropdown') : this.panelUsersBlock.removeAttr('data-toggle');
|
||||
this.panelUsersBlock.toggleClass('dropdown-toggle', length > 1);
|
||||
(length > 1) ? this.panelUsersBlock.off('click') : this.panelUsersBlock.on('click', _.bind(this.onUsersClick, this));
|
||||
},
|
||||
|
||||
|
|
|
@ -752,6 +752,9 @@ define([
|
|||
return;
|
||||
}
|
||||
|
||||
if (params.asc_getRights() !== Asc.c_oRights.Edit)
|
||||
this.permissions.edit = false;
|
||||
|
||||
this.appOptions.canAutosave = true;
|
||||
this.appOptions.canAnalytics = params.asc_getIsAnalyticsEnable();
|
||||
|
||||
|
|
|
@ -177,7 +177,8 @@ define([
|
|||
this._settings[settingsType].hidden = 0;
|
||||
}
|
||||
|
||||
var lastactive = -1, currentactive, priorityactive = -1;
|
||||
var lastactive = -1, currentactive, priorityactive = -1,
|
||||
activePane = this.rightmenu.GetActivePane();
|
||||
for (i=0; i<this._settings.length; ++i) {
|
||||
var pnl = this._settings[i];
|
||||
if (pnl===undefined) continue;
|
||||
|
@ -185,7 +186,7 @@ define([
|
|||
if ( pnl.hidden ) {
|
||||
if ( !pnl.btn.isDisabled() )
|
||||
pnl.btn.setDisabled(true);
|
||||
if (this.rightmenu.GetActivePane() == pnl.panelId)
|
||||
if (activePane == pnl.panelId)
|
||||
currentactive = -1;
|
||||
} else {
|
||||
if ( pnl.btn.isDisabled() )
|
||||
|
@ -194,7 +195,7 @@ define([
|
|||
if ( pnl.needShow ) {
|
||||
pnl.needShow = false;
|
||||
priorityactive = i;
|
||||
} else if (this.rightmenu.GetActivePane() == pnl.panelId)
|
||||
} else if (activePane == pnl.panelId)
|
||||
currentactive = i;
|
||||
pnl.panel.setLocked(pnl.locked);
|
||||
}
|
||||
|
|
|
@ -234,7 +234,7 @@ define([
|
|||
},
|
||||
|
||||
GetActivePane: function() {
|
||||
return (this.minimizedMode) ? null : $(".settings-panel.active")[0].id;
|
||||
return (this.minimizedMode) ? null : this.$el.find(".settings-panel.active")[0].id;
|
||||
},
|
||||
|
||||
clearSelection: function() {
|
||||
|
|
|
@ -300,7 +300,7 @@ define([
|
|||
});
|
||||
});
|
||||
|
||||
this.tabbar.$el.append('<div class="menu-backdrop" data-toggle="dropdown" style="width:0; height:0;"/>');
|
||||
this.tabbar.$el.append('<div class="menu-backdrop dropdown-toggle" data-toggle="dropdown" style="width:0; height:0;"/>');
|
||||
this.tabMenu.render(this.tabbar.$el);
|
||||
this.tabMenu.on('show:after', _.bind(this.onTabMenuAfterShow, this));
|
||||
this.tabMenu.on('hide:after', _.bind(this.onTabMenuAfterHide, this));
|
||||
|
@ -445,6 +445,7 @@ define([
|
|||
usertip.setContent();
|
||||
}
|
||||
(length > 1) ? this.panelUsersBlock.attr('data-toggle', 'dropdown') : this.panelUsersBlock.removeAttr('data-toggle');
|
||||
this.panelUsersBlock.toggleClass('dropdown-toggle', length > 1);
|
||||
(length > 1) ? this.panelUsersBlock.off('click') : this.panelUsersBlock.on('click', _.bind(this.onUsersClick, this));
|
||||
},
|
||||
|
||||
|
|
|
@ -598,7 +598,7 @@ define([
|
|||
me.listStyles = new Common.UI.ComboDataView({
|
||||
cls : 'combo-styles',
|
||||
enableKeyEvents : true,
|
||||
itemWidth : 104,
|
||||
itemWidth : 112,
|
||||
itemHeight : 38,
|
||||
hint : this.tipCellStyle,
|
||||
menuMaxHeight : 226,
|
||||
|
|
Loading…
Reference in a new issue