Merge branch 'feature/pe-pointer' into develop
|
Before Width: | Height: | Size: 526 B After Width: | Height: | Size: 526 B |
|
Before Width: | Height: | Size: 661 B After Width: | Height: | Size: 661 B |
|
Before Width: | Height: | Size: 870 B After Width: | Height: | Size: 870 B |
|
Before Width: | Height: | Size: 485 B After Width: | Height: | Size: 485 B |
|
Before Width: | Height: | Size: 938 B After Width: | Height: | Size: 938 B |
|
Before Width: | Height: | Size: 961 B After Width: | Height: | Size: 961 B |
|
Before Width: | Height: | Size: 526 B |
|
Before Width: | Height: | Size: 661 B |
|
Before Width: | Height: | Size: 870 B |
|
Before Width: | Height: | Size: 485 B |
@ -1 +0,0 @@
|
||||
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 3.5a1.5 1.5 0 0 1 2.947-.395A1.5 1.5 0 0 1 14 4.5v1.585a1.506 1.506 0 0 1 2.004 1.412c0 .13 0 .26.002.39.008 1.241.016 2.44-.041 3.541-.063 1.214-.206 2.344-.53 3.31-.327.975-.846 1.806-1.67 2.388-.824.58-1.897.874-3.266.874-1.676 0-3.065-1.152-4.147-2.499-1.096-1.365-1.973-3.05-2.608-4.35C3.259 10.158 3.994 9 5.092 9c.394 0 .771.156 1.05.435l.858.858V5.5a1.5 1.5 0 0 1 2-1.415V3.5Zm1 0V10a.5.5 0 0 1-1 0V5.5a.5.5 0 1 0-1 0v6a.5.5 0 0 1-.854.354l-1.712-1.712A.484.484 0 0 0 5.092 10a.5.5 0 0 0-.45.712c.632 1.293 1.469 2.892 2.49 4.163C8.167 16.164 9.298 17 10.499 17c1.228 0 2.082-.263 2.689-.691.605-.427 1.02-1.056 1.299-1.888.281-.84.418-1.864.48-3.044.054-1.07.047-2.24.039-3.487l-.003-.386A.506.506 0 0 0 14.5 7a.5.5 0 0 0-.5.5V10a.5.5 0 1 1-1 0V4.5a.5.5 0 1 0-1 0V10a.5.5 0 1 1-1 0V3.5a.5.5 0 1 0-1 0Z" fill="#000"/></svg>
|
||||
|
Before Width: | Height: | Size: 938 B |
|
Before Width: | Height: | Size: 961 B |
@ -943,8 +943,6 @@ define([
|
||||
value = Common.localStorage.getBool('pe-hidden-notes', this.appOptions.customization && this.appOptions.customization.hideNotes===true);
|
||||
me.api.asc_ShowNotes(!value);
|
||||
|
||||
me.api.asc_setViewerTargetType(this.appOptions.customization && this.appOptions.customization.pointerMode==='hand' ? 'hand' : 'select');
|
||||
|
||||
function checkWarns() {
|
||||
if (!Common.Controllers.Desktop.isActive()) {
|
||||
var tips = [];
|
||||
|
||||
@ -67,6 +67,7 @@ define([
|
||||
Common.NotificationCenter.on('document:ready', _.bind(this.onDocumentReady, this));
|
||||
Common.NotificationCenter.on('settings:unitschanged', _.bind(this.unitsChanged, this));
|
||||
Common.NotificationCenter.on('tabstyle:changed', this.onTabStyleChange.bind(this));
|
||||
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
|
||||
},
|
||||
|
||||
setApi: function (api) {
|
||||
@ -112,7 +113,9 @@ define([
|
||||
'gridlines:spacing': _.bind(this.onGridlinesSpacing, this),
|
||||
'gridlines:custom': _.bind(this.onGridlinesCustom, this),
|
||||
'gridlines:aftershow': _.bind(this.onGridlinesAfterShow, this),
|
||||
'macros:click': _.bind(this.onClickMacros, this)
|
||||
'macros:click': _.bind(this.onClickMacros, this),
|
||||
'pointer:select': _.bind(this.onPointerType, this, 'select'),
|
||||
'pointer:hand': _.bind(this.onPointerType, this, 'hand')
|
||||
},
|
||||
'Toolbar': {
|
||||
'view:compact': _.bind(function (toolbar, state) {
|
||||
@ -430,12 +433,32 @@ define([
|
||||
this.changeViewMode(mode);
|
||||
},
|
||||
|
||||
onPointerType: function (type) {
|
||||
if (this.api) {
|
||||
this.api.asc_setViewerTargetType(type);
|
||||
Common.NotificationCenter.trigger('edit:complete', this.view);
|
||||
}
|
||||
},
|
||||
|
||||
onTabStyleChange: function () {
|
||||
if (this.view && this.view.menuTabStyle) {
|
||||
_.each(this.view.menuTabStyle.items, function(item){
|
||||
item.setChecked(Common.Utils.InternalSettings.get("settings-tab-style")===item.value, true);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
onAppReady: function (config) {
|
||||
var me = this;
|
||||
(new Promise(function (accept, reject) {
|
||||
accept();
|
||||
})).then(function () {
|
||||
if (me.view && me.view.btnHandTool) {
|
||||
var hand = config && config.customization && config.customization.pointerMode==='hand';
|
||||
me.api && me.api.asc_setViewerTargetType(hand ? 'hand' : 'select');
|
||||
me.view[hand ? 'btnHandTool' : 'btnSelectTool'].toggle(true, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}, PE.Controllers.ViewTab || {}));
|
||||
|
||||
@ -51,6 +51,11 @@ define([
|
||||
'<span class="btn-slot text x-huge" id="slot-btn-slide-master"></span>' +
|
||||
'</div>' +
|
||||
'<div class="separator long"></div>' +
|
||||
'<div class="group">' +
|
||||
'<span class="btn-slot text x-huge" id="slot-btn-hand-tool"></span>' +
|
||||
'<span class="btn-slot text x-huge" id="slot-btn-select-tool"></span>' +
|
||||
'</div>' +
|
||||
'<div class="separator long"></div>' +
|
||||
'<div class="group small">' +
|
||||
'<div class="elset" style="display: flex;">' +
|
||||
'<span class="btn-slot" id="slot-field-zoom" style="flex-grow: 1;"></span>' +
|
||||
@ -189,6 +194,12 @@ define([
|
||||
me.btnMacros && me.btnMacros.on('click', function () {
|
||||
me.fireEvent('macros:click');
|
||||
});
|
||||
me.btnSelectTool && me.btnSelectTool.on('toggle', _.bind(function(btn, state) {
|
||||
state && me.fireEvent('pointer:select');
|
||||
}, me));
|
||||
me.btnHandTool && me.btnHandTool.on('toggle', _.bind(function(btn, state) {
|
||||
state && me.fireEvent('pointer:hand');
|
||||
}, me));
|
||||
},
|
||||
|
||||
initialize: function (options) {
|
||||
@ -397,6 +408,36 @@ define([
|
||||
});
|
||||
this.lockedControls.push(this.btnMacros);
|
||||
}
|
||||
if (!this.appConfig.isEdit && !this.appConfig.isRestrictedEdit) {
|
||||
this.btnSelectTool = new Common.UI.Button({
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
iconCls: 'toolbar__icon btn-select',
|
||||
lock: [_set.disableOnStart],
|
||||
caption: me.capBtnSelect,
|
||||
toggleGroup: 'select-tools-tb',
|
||||
enableToggle: true,
|
||||
allowDepress: false,
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'bottom',
|
||||
dataHintOffset: 'small'
|
||||
});
|
||||
this.lockedControls.push(this.btnSelectTool);
|
||||
|
||||
this.btnHandTool = new Common.UI.Button({
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
iconCls: 'toolbar__icon btn-big-hand-tool',
|
||||
lock: [_set.disableOnStart],
|
||||
caption: me.capBtnHand,
|
||||
toggleGroup: 'select-tools-tb',
|
||||
enableToggle: true,
|
||||
allowDepress: false,
|
||||
dataHint: '1',
|
||||
dataHintDirection: 'bottom',
|
||||
dataHintOffset: 'small'
|
||||
});
|
||||
this.lockedControls.push(this.btnHandTool);
|
||||
}
|
||||
|
||||
Common.UI.LayoutManager.addControls(this.lockedControls);
|
||||
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
|
||||
},
|
||||
@ -427,6 +468,8 @@ define([
|
||||
this.chLeftMenu.render($host.find('#slot-chk-leftmenu'));
|
||||
this.chRightMenu.render($host.find('#slot-chk-rightmenu'));
|
||||
this.btnMacros && this.btnMacros.render($host.find('#slot-btn-macros'));
|
||||
this.btnSelectTool && this.btnSelectTool.render($host.find('#slot-btn-select-tool'));
|
||||
this.btnHandTool && this.btnHandTool.render($host.find('#slot-btn-hand-tool'));
|
||||
return this.$el;
|
||||
},
|
||||
|
||||
@ -443,7 +486,8 @@ define([
|
||||
me.btnGuides.updateHint(me.tipGuides);
|
||||
me.btnGridlines.updateHint(me.tipGridlines);
|
||||
me.btnMacros && me.btnMacros.updateHint(me.tipMacros);
|
||||
|
||||
me.btnSelectTool && me.btnSelectTool.updateHint(me.tipSelectTool);
|
||||
me.btnHandTool && me.btnHandTool.updateHint(me.tipHandTool);
|
||||
me.btnGuides.setMenu( new Common.UI.Menu({
|
||||
cls: 'shifted-right',
|
||||
items: [
|
||||
@ -504,6 +548,9 @@ define([
|
||||
me.$el.find('#slot-btn-slide-master').closest('.group').next().addBack().remove();
|
||||
me.$el.find('#slot-btn-macros').closest('.group').prev().addBack().remove();
|
||||
}
|
||||
if (config.isEdit || config.isRestrictedEdit) {
|
||||
me.$el.find('#slot-btn-hand-tool').closest('.group').next().addBack().remove();
|
||||
}
|
||||
|
||||
if (Common.UI.Themes.available()) {
|
||||
function _add_tab_styles() {
|
||||
|
||||
@ -2952,5 +2952,9 @@
|
||||
"PE.Views.ViewTab.tipSlideMaster": "Slide master",
|
||||
"PE.Views.Toolbar.textTabDesign": "Design",
|
||||
"PE.Views.ViewTab.textMacros": "Macros",
|
||||
"PE.Views.ViewTab.tipMacros": "Macros"
|
||||
"PE.Views.ViewTab.tipMacros": "Macros",
|
||||
"PE.Views.ViewTab.capBtnHand": "Hand",
|
||||
"PE.Views.ViewTab.capBtnSelect": "Select",
|
||||
"PE.Views.ViewTab.tipSelectTool": "Select tool",
|
||||
"PE.Views.ViewTab.tipHandTool": "Hand tool"
|
||||
}
|
||||
|
||||