Merge pull request #9 from ONLYOFFICE/feature/bugfix

Feature/bugfix
This commit is contained in:
Julia Radzhabova 2017-09-20 10:24:14 +03:00 committed by GitHub
commit 49b4759129
8 changed files with 29 additions and 15 deletions

View file

@ -66,6 +66,7 @@ define([
PAGEUP: 33, PAGEUP: 33,
PAGEDOWN: 34, PAGEDOWN: 34,
INSERT: 45, INSERT: 45,
EQUALITY_FF:61,
NUM_PLUS: 107, NUM_PLUS: 107,
NUM_MINUS: 109, NUM_MINUS: 109,
F1: 112, F1: 112,
@ -80,6 +81,7 @@ define([
F10: 121, F10: 121,
F11: 122, F11: 122,
F12: 123, F12: 123,
MINUS_FF: 173,
EQUALITY: 187, EQUALITY: 187,
MINUS: 189 MINUS: 189
}, },

View file

@ -212,12 +212,12 @@ define([
}); });
if ( me.logo ) if ( me.logo )
me.logo.on('click', function (e) { me.logo.children(0).on('click', function (e) {
var _url = !!me.branding && !!me.branding.logo && !!me.branding.logo.url ? var _url = !!me.branding && !!me.branding.logo && !!me.branding.logo.url ?
me.branding.logo.url : 'http://www.onlyoffice.com'; me.branding.logo.url : 'http://www.onlyoffice.com';
// var newDocumentPage = window.open(_url); var newDocumentPage = window.open(_url);
// newDocumentPage && newDocumentPage.focus(); newDocumentPage && newDocumentPage.focus();
}); });
onResetUsers(storeUsers); onResetUsers(storeUsers);

View file

@ -126,15 +126,19 @@
#header-logo { #header-logo {
max-width: 200px; max-width: 200px;
height: 100%; height: 100%;
//cursor: pointer;
padding: 7px 24px 7px 12px; padding: 7px 24px 7px 12px;
i { i {
cursor: pointer;
width: 86px; width: 86px;
height: 20px; height: 20px;
display: block; display: block;
.background-ximage('@{common-image-path}/header/header-logo.png', '@{common-image-path}/header/header-logo@2x.png', 86px); .background-ximage('@{common-image-path}/header/header-logo.png', '@{common-image-path}/header/header-logo@2x.png', 86px);
} }
img {
cursor: pointer;
}
} }
} }

View file

@ -267,13 +267,13 @@ define([
if (me.api){ if (me.api){
var key = event.keyCode; var key = event.keyCode;
if ((event.ctrlKey || event.metaKey) && !event.shiftKey && !event.altKey){ if ((event.ctrlKey || event.metaKey) && !event.shiftKey && !event.altKey){
if (key === Common.UI.Keys.NUM_PLUS || key === Common.UI.Keys.EQUALITY || (Common.Utils.isOpera && key == 43)){ if (key === Common.UI.Keys.NUM_PLUS || key === Common.UI.Keys.EQUALITY || (Common.Utils.isGecko && key === Common.UI.Keys.EQUALITY_FF) || (Common.Utils.isOpera && key == 43)){
me.api.zoomIn(); me.api.zoomIn();
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
return false; return false;
} }
else if (key === Common.UI.Keys.NUM_MINUS || key === Common.UI.Keys.MINUS || (Common.Utils.isOpera && key == 45)){ else if (key === Common.UI.Keys.NUM_MINUS || key === Common.UI.Keys.MINUS || (Common.Utils.isGecko && key === Common.UI.Keys.MINUS_FF) || (Common.Utils.isOpera && key == 45)){
me.api.zoomOut(); me.api.zoomOut();
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();

View file

@ -273,13 +273,13 @@ define([
if (me.api){ if (me.api){
var key = event.keyCode; var key = event.keyCode;
if ((event.ctrlKey || event.metaKey) && !event.shiftKey && !event.altKey){ if ((event.ctrlKey || event.metaKey) && !event.shiftKey && !event.altKey){
if (key === Common.UI.Keys.NUM_PLUS || key === Common.UI.Keys.EQUALITY || (Common.Utils.isOpera && key == 43)){ if (key === Common.UI.Keys.NUM_PLUS || key === Common.UI.Keys.EQUALITY || (Common.Utils.isGecko && key === Common.UI.Keys.EQUALITY_FF) || (Common.Utils.isOpera && key == 43)){
me.api.zoomIn(); me.api.zoomIn();
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
return false; return false;
} }
else if (key === Common.UI.Keys.NUM_MINUS || key === Common.UI.Keys.MINUS || (Common.Utils.isOpera && key == 45)){ else if (key === Common.UI.Keys.NUM_MINUS || key === Common.UI.Keys.MINUS || (Common.Utils.isGecko && key === Common.UI.Keys.MINUS_FF) || (Common.Utils.isOpera && key == 45)){
me.api.zoomOut(); me.api.zoomOut();
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();

View file

@ -276,14 +276,17 @@ define([
var me = this; var me = this;
var controls = $(this.el).find('.preview-controls'); var controls = $(this.el).find('.preview-controls');
controls.css('display', 'none'); controls.css('display', 'none');
me.$el.css('cursor', 'none');
setTimeout(function(){ setTimeout(function(){
me.$el.on('mousemove', function() { me.$el.on('mousemove', function() {
clearTimeout(me.timerMove); clearTimeout(me.timerMove);
controls.css('display', ''); controls.css('display', '');
me.$el.css('cursor', '');
if (!controls.hasClass('over')) if (!controls.hasClass('over'))
me.timerMove = setTimeout(function () { me.timerMove = setTimeout(function () {
controls.css('display', 'none'); controls.css('display', 'none');
me.$el.css('cursor', 'none');
}, 3000); }, 3000);
}); });

View file

@ -98,6 +98,7 @@ define([
this.hkComments = 'alt+h'; this.hkComments = 'alt+h';
keymap[this.hkComments] = function() { keymap[this.hkComments] = function() {
me.onAddComment(); me.onAddComment();
return false;
}; };
Common.util.Shortcuts.delegateShortcuts({shortcuts:keymap}); Common.util.Shortcuts.delegateShortcuts({shortcuts:keymap});
}, },
@ -1175,7 +1176,7 @@ define([
if (this.api){ if (this.api){
var key = event.keyCode; var key = event.keyCode;
if ((event.ctrlKey || event.metaKey) && !event.shiftKey && !event.altKey){ if ((event.ctrlKey || event.metaKey) && !event.shiftKey && !event.altKey){
if (key === Common.UI.Keys.NUM_PLUS || key === Common.UI.Keys.EQUALITY || (Common.Utils.isOpera && key == 43)){ if (key === Common.UI.Keys.NUM_PLUS || key === Common.UI.Keys.EQUALITY || (Common.Utils.isGecko && key === Common.UI.Keys.EQUALITY_FF) || (Common.Utils.isOpera && key == 43)){
if (!this.api.isCellEdited) { if (!this.api.isCellEdited) {
var factor = Math.floor(this.api.asc_getZoom() * 10)/10; var factor = Math.floor(this.api.asc_getZoom() * 10)/10;
factor += .1; factor += .1;
@ -1187,7 +1188,7 @@ define([
event.stopPropagation(); event.stopPropagation();
return false; return false;
} }
} else if (key === Common.UI.Keys.NUM_MINUS || key === Common.UI.Keys.MINUS || (Common.Utils.isOpera && key == 45)){ } else if (key === Common.UI.Keys.NUM_MINUS || key === Common.UI.Keys.MINUS || (Common.Utils.isGecko && key === Common.UI.Keys.MINUS_FF) || (Common.Utils.isOpera && key == 45)){
if (!this.api.isCellEdited) { if (!this.api.isCellEdited) {
factor = Math.ceil(this.api.asc_getZoom() * 10)/10; factor = Math.ceil(this.api.asc_getZoom() * 10)/10;
factor -= .1; factor -= .1;
@ -1228,7 +1229,7 @@ define([
onSelectionChanged: function(info){ onSelectionChanged: function(info){
if (!this.mouse.isLeftButtonDown && !this.rangeSelectionMode && if (!this.mouse.isLeftButtonDown && !this.rangeSelectionMode &&
this.currentMenu && this.currentMenu.isVisible()){ this.currentMenu && this.currentMenu.isVisible()){
(this.permissions.isEdit) ? this.fillMenuProps(info, true, event) : this.fillViewMenuProps(info, true, event); (this.permissions.isEdit) ? this.fillMenuProps(info, true) : this.fillViewMenuProps(info, true);
} }
}, },
@ -1416,7 +1417,6 @@ define([
documentHolder.pmiEntireShow.setVisible(iscolmenu||isrowmenu); documentHolder.pmiEntireShow.setVisible(iscolmenu||isrowmenu);
documentHolder.pmiFreezePanes.setVisible(!iscelledit); documentHolder.pmiFreezePanes.setVisible(!iscelledit);
documentHolder.pmiFreezePanes.setCaption(this.api.asc_getSheetViewSettings().asc_getIsFreezePane() ? documentHolder.textUnFreezePanes : documentHolder.textFreezePanes); documentHolder.pmiFreezePanes.setCaption(this.api.asc_getSheetViewSettings().asc_getIsFreezePane() ? documentHolder.textUnFreezePanes : documentHolder.textFreezePanes);
documentHolder.pmiEntriesList.setVisible(!iscelledit);
/** coauthoring begin **/ /** coauthoring begin **/
documentHolder.ssMenu.items[17].setVisible(iscellmenu && !iscelledit && this.permissions.canCoAuthoring && this.permissions.canComments); documentHolder.ssMenu.items[17].setVisible(iscellmenu && !iscelledit && this.permissions.canCoAuthoring && this.permissions.canComments);
@ -1447,6 +1447,8 @@ define([
var inPivot = !!cellinfo.asc_getPivotTableInfo(); var inPivot = !!cellinfo.asc_getPivotTableInfo();
documentHolder.pmiEntriesList.setVisible(!iscelledit && !inPivot);
_.each(documentHolder.ssMenu.items, function(item) { _.each(documentHolder.ssMenu.items, function(item) {
item.setDisabled(isCellLocked); item.setDisabled(isCellLocked);
}); });
@ -1503,7 +1505,7 @@ define([
}, },
showPopupMenu: function(menu, value, event){ showPopupMenu: function(menu, value, event){
if (!_.isUndefined(menu) && menu !== null){ if (!_.isUndefined(menu) && menu !== null && event){
Common.UI.Menu.Manager.hideAll(); Common.UI.Menu.Manager.hideAll();
var me = this, var me = this,

View file

@ -1392,8 +1392,11 @@ define([
shortcuts: { shortcuts: {
'command+l,ctrl+l': function(e) { 'command+l,ctrl+l': function(e) {
if ( me.editMode && !me._state.multiselect ) { if ( me.editMode && !me._state.multiselect ) {
var formattableinfo = me.api.asc_getCellInfo().asc_getFormatTableInfo(); var cellinfo = me.api.asc_getCellInfo(),
if (!formattableinfo) { filterinfo = cellinfo.asc_getAutoFilterInfo(),
formattableinfo = cellinfo.asc_getFormatTableInfo();
filterinfo = (filterinfo) ? filterinfo.asc_getIsAutoFilter() : null;
if (filterinfo!==null && !formattableinfo) {
if (_.isUndefined(me.toolbar.mnuTableTemplatePicker)) if (_.isUndefined(me.toolbar.mnuTableTemplatePicker))
me.onApiInitTableTemplates(me.api.asc_getTablePictures(formattableinfo)); me.onApiInitTableTemplates(me.api.asc_getTablePictures(formattableinfo));
var store = me.getCollection('TableTemplates'); var store = me.getCollection('TableTemplates');