[SSE] Add Table button to the Insert tab
This commit is contained in:
parent
34950ab65c
commit
3eef24e5d5
|
@ -311,6 +311,7 @@ define([
|
||||||
toolbar.btnAlignBottom.on('click', _.bind(this.onVerticalAlign, this, Asc.c_oAscVAlign.Bottom));
|
toolbar.btnAlignBottom.on('click', _.bind(this.onVerticalAlign, this, Asc.c_oAscVAlign.Bottom));
|
||||||
toolbar.btnWrap.on('click', _.bind(this.onWrap, this));
|
toolbar.btnWrap.on('click', _.bind(this.onWrap, this));
|
||||||
toolbar.btnTextOrient.menu.on('item:click', _.bind(this.onTextOrientationMenu, this));
|
toolbar.btnTextOrient.menu.on('item:click', _.bind(this.onTextOrientationMenu, this));
|
||||||
|
toolbar.btnInsertTable.on('click', _.bind(this.onBtnInsertTableClick, this));
|
||||||
toolbar.btnInsertImage.menu.on('item:click', _.bind(this.onInsertImageMenu, this));
|
toolbar.btnInsertImage.menu.on('item:click', _.bind(this.onInsertImageMenu, this));
|
||||||
toolbar.btnInsertHyperlink.on('click', _.bind(this.onHyperlink, this));
|
toolbar.btnInsertHyperlink.on('click', _.bind(this.onHyperlink, this));
|
||||||
toolbar.mnuInsertChartPicker.on('item:click', _.bind(this.onSelectChart, this));
|
toolbar.mnuInsertChartPicker.on('item:click', _.bind(this.onSelectChart, this));
|
||||||
|
@ -820,6 +821,13 @@ define([
|
||||||
Common.component.Analytics.trackEvent('ToolBar', 'Text orientation');
|
Common.component.Analytics.trackEvent('ToolBar', 'Text orientation');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onBtnInsertTableClick: function(btn, e) {
|
||||||
|
if (this.api)
|
||||||
|
this._setTableFormat(this.api.asc_getDefaultTableStyle());
|
||||||
|
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
||||||
|
Common.component.Analytics.trackEvent('ToolBar', 'Table');
|
||||||
|
},
|
||||||
|
|
||||||
onInsertImageMenu: function(menu, item, e) {
|
onInsertImageMenu: function(menu, item, e) {
|
||||||
if (item.value === 'file') {
|
if (item.value === 'file') {
|
||||||
this.toolbar.fireEvent('insertimage', this.toolbar);
|
this.toolbar.fireEvent('insertimage', this.toolbar);
|
||||||
|
@ -1447,9 +1455,6 @@ define([
|
||||||
formattableinfo = cellinfo.asc_getFormatTableInfo();
|
formattableinfo = cellinfo.asc_getFormatTableInfo();
|
||||||
filterinfo = (filterinfo) ? filterinfo.asc_getIsAutoFilter() : null;
|
filterinfo = (filterinfo) ? filterinfo.asc_getIsAutoFilter() : null;
|
||||||
if (filterinfo!==null && !formattableinfo) {
|
if (filterinfo!==null && !formattableinfo) {
|
||||||
if (_.isUndefined(me.toolbar.mnuTableTemplatePicker))
|
|
||||||
me.onApiInitTableTemplates(me.api.asc_getTablePictures(formattableinfo));
|
|
||||||
var store = me.getCollection('TableTemplates');
|
|
||||||
me._setTableFormat(me.api.asc_getDefaultTableStyle());
|
me._setTableFormat(me.api.asc_getDefaultTableStyle());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2165,7 +2170,7 @@ define([
|
||||||
|
|
||||||
need_disable = this._state.controlsdisabled.filters || formatTableInfo!==null || filterInfo && filterInfo.asc_getIsAutoFilter()===null;
|
need_disable = this._state.controlsdisabled.filters || formatTableInfo!==null || filterInfo && filterInfo.asc_getIsAutoFilter()===null;
|
||||||
// (need_disable !== toolbar.btnMerge.isDisabled()) && toolbar.btnMerge.setDisabled(need_disable);
|
// (need_disable !== toolbar.btnMerge.isDisabled()) && toolbar.btnMerge.setDisabled(need_disable);
|
||||||
toolbar.lockToolbar(SSE.enumLock.ruleMerge, need_disable, {array:[toolbar.btnMerge]});
|
toolbar.lockToolbar(SSE.enumLock.ruleMerge, need_disable, {array:[toolbar.btnMerge, toolbar.btnInsertTable]});
|
||||||
|
|
||||||
val = info.asc_getFlags().asc_getMerge();
|
val = info.asc_getFlags().asc_getMerge();
|
||||||
if (this._state.merge !== val) {
|
if (this._state.merge !== val) {
|
||||||
|
@ -2190,7 +2195,7 @@ define([
|
||||||
}
|
}
|
||||||
need_disable = this._state.controlsdisabled.filters || (val===null);
|
need_disable = this._state.controlsdisabled.filters || (val===null);
|
||||||
toolbar.lockToolbar(SSE.enumLock.ruleFilter, need_disable,
|
toolbar.lockToolbar(SSE.enumLock.ruleFilter, need_disable,
|
||||||
{ array: toolbar.btnsSetAutofilter.concat(toolbar.btnsSortDown, toolbar.btnsSortUp, toolbar.btnTableTemplate) });
|
{ array: toolbar.btnsSetAutofilter.concat(toolbar.btnsSortDown, toolbar.btnsSortUp, toolbar.btnTableTemplate, toolbar.btnInsertTable) });
|
||||||
|
|
||||||
val = (formatTableInfo) ? formatTableInfo.asc_getTableStyleName() : null;
|
val = (formatTableInfo) ? formatTableInfo.asc_getTableStyleName() : null;
|
||||||
if (this._state.tablestylename !== val && this.toolbar.mnuTableTemplatePicker) {
|
if (this._state.tablestylename !== val && this.toolbar.mnuTableTemplatePicker) {
|
||||||
|
@ -2217,13 +2222,14 @@ define([
|
||||||
this.getApplication().getController('Statusbar').onApiFilterInfo(!need_disable);
|
this.getApplication().getController('Statusbar').onApiFilterInfo(!need_disable);
|
||||||
|
|
||||||
this._state.multiselect = info.asc_getFlags().asc_getMultiselect();
|
this._state.multiselect = info.asc_getFlags().asc_getMultiselect();
|
||||||
toolbar.lockToolbar(SSE.enumLock.multiselect, this._state.multiselect, { array: [toolbar.btnTableTemplate, toolbar.btnInsertHyperlink]});
|
toolbar.lockToolbar(SSE.enumLock.multiselect, this._state.multiselect, { array: [toolbar.btnTableTemplate, toolbar.btnInsertHyperlink, toolbar.btnInsertTable]});
|
||||||
|
|
||||||
this._state.inpivot = !!info.asc_getPivotTableInfo();
|
this._state.inpivot = !!info.asc_getPivotTableInfo();
|
||||||
toolbar.lockToolbar(SSE.enumLock.editPivot, this._state.inpivot, { array: toolbar.btnsSetAutofilter.concat(toolbar.btnsClearAutofilter, toolbar.btnsSortDown, toolbar.btnsSortUp, toolbar.btnMerge, toolbar.btnInsertHyperlink)});
|
toolbar.lockToolbar(SSE.enumLock.editPivot, this._state.inpivot, { array: toolbar.btnsSetAutofilter.concat(toolbar.btnsClearAutofilter, toolbar.btnsSortDown, toolbar.btnsSortUp, toolbar.btnMerge, toolbar.btnInsertHyperlink, toolbar.btnInsertTable)});
|
||||||
|
|
||||||
need_disable = !this.appConfig.canModifyFilter;
|
need_disable = !this.appConfig.canModifyFilter;
|
||||||
toolbar.lockToolbar(SSE.enumLock.cantModifyFilter, need_disable, { array: toolbar.btnsSetAutofilter.concat(toolbar.btnsSortDown, toolbar.btnsSortUp, toolbar.btnTableTemplate, toolbar.btnClearStyle.menu.items[0], toolbar.btnClearStyle.menu.items[2])});
|
toolbar.lockToolbar(SSE.enumLock.cantModifyFilter, need_disable, { array: toolbar.btnsSetAutofilter.concat(toolbar.btnsSortDown, toolbar.btnsSortUp, toolbar.btnTableTemplate, toolbar.btnClearStyle.menu.items[0], toolbar.btnClearStyle.menu.items[2],
|
||||||
|
toolbar.btnInsertTable)});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -119,6 +119,10 @@
|
||||||
<div class="group" id="slot-field-styles" style="width: 100%; min-width: 160px;"></div>
|
<div class="group" id="slot-field-styles" style="width: 100%; min-width: 160px;"></div>
|
||||||
</section>
|
</section>
|
||||||
<section class="panel" data-tab="ins">
|
<section class="panel" data-tab="ins">
|
||||||
|
<div class="group">
|
||||||
|
<span class="btn-slot text x-huge" id="slot-btn-instable"></span>
|
||||||
|
</div>
|
||||||
|
<div class="separator long"></div>
|
||||||
<div class="group">
|
<div class="group">
|
||||||
<span class="btn-slot text x-huge" id="slot-btn-insimage"></span>
|
<span class="btn-slot text x-huge" id="slot-btn-insimage"></span>
|
||||||
<span class="btn-slot text x-huge" id="slot-btn-insshape"></span>
|
<span class="btn-slot text x-huge" id="slot-btn-insshape"></span>
|
||||||
|
|
|
@ -728,6 +728,14 @@ define([
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
me.btnInsertTable = new Common.UI.Button({
|
||||||
|
id : 'tlbtn-inserttable',
|
||||||
|
cls : 'btn-toolbar x-huge icon-top',
|
||||||
|
iconCls : 'btn-inserttable',
|
||||||
|
caption : me.capInsertTable,
|
||||||
|
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleFilter, _set.multiselect, _set.cantModifyFilter, _set.ruleMerge, _set.editPivot]
|
||||||
|
});
|
||||||
|
|
||||||
me.listStyles = new Common.UI.ComboDataView({
|
me.listStyles = new Common.UI.ComboDataView({
|
||||||
cls : 'combo-styles',
|
cls : 'combo-styles',
|
||||||
enableKeyEvents : true,
|
enableKeyEvents : true,
|
||||||
|
@ -1386,7 +1394,7 @@ define([
|
||||||
me.cmbFontName, me.cmbFontSize, me.btnIncFontSize, me.btnDecFontSize, me.btnBold,
|
me.cmbFontName, me.cmbFontSize, me.btnIncFontSize, me.btnDecFontSize, me.btnBold,
|
||||||
me.btnItalic, me.btnUnderline, me.btnStrikeout, me.btnSubscript, me.btnTextColor, me.btnHorizontalAlign, me.btnAlignLeft,
|
me.btnItalic, me.btnUnderline, me.btnStrikeout, me.btnSubscript, me.btnTextColor, me.btnHorizontalAlign, me.btnAlignLeft,
|
||||||
me.btnAlignCenter,me.btnAlignRight,me.btnAlignJust, me.btnVerticalAlign, me.btnAlignTop,
|
me.btnAlignCenter,me.btnAlignRight,me.btnAlignJust, me.btnVerticalAlign, me.btnAlignTop,
|
||||||
me.btnAlignMiddle, me.btnAlignBottom, me.btnWrap, me.btnTextOrient, me.btnBackColor,
|
me.btnAlignMiddle, me.btnAlignBottom, me.btnWrap, me.btnTextOrient, me.btnBackColor, me.btnInsertTable,
|
||||||
me.btnMerge, me.btnInsertFormula, me.btnNamedRange, me.btnIncDecimal, me.btnInsertShape, me.btnInsertEquation,
|
me.btnMerge, me.btnInsertFormula, me.btnNamedRange, me.btnIncDecimal, me.btnInsertShape, me.btnInsertEquation,
|
||||||
me.btnInsertText, me.btnInsertTextArt, me.btnSortUp, me.btnSortDown, me.btnSetAutofilter, me.btnClearAutofilter,
|
me.btnInsertText, me.btnInsertTextArt, me.btnSortUp, me.btnSortDown, me.btnSetAutofilter, me.btnClearAutofilter,
|
||||||
me.btnTableTemplate, me.btnPercentStyle, me.btnCurrencyStyle, me.btnDecDecimal, me.btnAddCell, me.btnDeleteCell,
|
me.btnTableTemplate, me.btnPercentStyle, me.btnCurrencyStyle, me.btnDecDecimal, me.btnAddCell, me.btnDeleteCell,
|
||||||
|
@ -1519,6 +1527,7 @@ define([
|
||||||
_injectComponent('#slot-btn-wrap', this.btnWrap);
|
_injectComponent('#slot-btn-wrap', this.btnWrap);
|
||||||
_injectComponent('#slot-btn-text-orient', this.btnTextOrient);
|
_injectComponent('#slot-btn-text-orient', this.btnTextOrient);
|
||||||
_injectComponent('#slot-btn-insimage', this.btnInsertImage);
|
_injectComponent('#slot-btn-insimage', this.btnInsertImage);
|
||||||
|
_injectComponent('#slot-btn-instable', this.btnInsertTable);
|
||||||
_injectComponent('#slot-btn-inshyperlink', this.btnInsertHyperlink);
|
_injectComponent('#slot-btn-inshyperlink', this.btnInsertHyperlink);
|
||||||
_injectComponent('#slot-btn-insshape', this.btnInsertShape);
|
_injectComponent('#slot-btn-insshape', this.btnInsertShape);
|
||||||
_injectComponent('#slot-btn-instext', this.btnInsertText);
|
_injectComponent('#slot-btn-instext', this.btnInsertText);
|
||||||
|
@ -1595,6 +1604,7 @@ define([
|
||||||
_updateHint(this.btnAlignBottom, this.tipAlignBottom);
|
_updateHint(this.btnAlignBottom, this.tipAlignBottom);
|
||||||
_updateHint(this.btnWrap, this.tipWrap);
|
_updateHint(this.btnWrap, this.tipWrap);
|
||||||
_updateHint(this.btnTextOrient, this.tipTextOrientation);
|
_updateHint(this.btnTextOrient, this.tipTextOrientation);
|
||||||
|
_updateHint(this.btnInsertTable, this.tipInsertTable);
|
||||||
_updateHint(this.btnInsertImage, this.tipInsertImage);
|
_updateHint(this.btnInsertImage, this.tipInsertImage);
|
||||||
_updateHint(this.btnInsertChart, this.tipInsertChartSpark);
|
_updateHint(this.btnInsertChart, this.tipInsertChartSpark);
|
||||||
_updateHint(this.btnInsertText, this.tipInsertText);
|
_updateHint(this.btnInsertText, this.tipInsertText);
|
||||||
|
@ -2350,6 +2360,8 @@ define([
|
||||||
tipPrintArea: 'Print Area',
|
tipPrintArea: 'Print Area',
|
||||||
capBtnInsHeader: 'Header/Footer',
|
capBtnInsHeader: 'Header/Footer',
|
||||||
tipEditHeader: 'Edit header or footer',
|
tipEditHeader: 'Edit header or footer',
|
||||||
textTabData: 'Data'
|
textTabData: 'Data',
|
||||||
|
capInsertTable: 'Table',
|
||||||
|
tipInsertTable: 'Insert table'
|
||||||
}, SSE.Views.Toolbar || {}));
|
}, SSE.Views.Toolbar || {}));
|
||||||
});
|
});
|
|
@ -2262,6 +2262,7 @@
|
||||||
"SSE.Views.Toolbar.tipInsertImage": "Insert image",
|
"SSE.Views.Toolbar.tipInsertImage": "Insert image",
|
||||||
"SSE.Views.Toolbar.tipInsertOpt": "Insert cells",
|
"SSE.Views.Toolbar.tipInsertOpt": "Insert cells",
|
||||||
"SSE.Views.Toolbar.tipInsertShape": "Insert autoshape",
|
"SSE.Views.Toolbar.tipInsertShape": "Insert autoshape",
|
||||||
|
"SSE.Views.Toolbar.tipInsertTable": "Insert table",
|
||||||
"SSE.Views.Toolbar.tipInsertText": "Insert text box",
|
"SSE.Views.Toolbar.tipInsertText": "Insert text box",
|
||||||
"SSE.Views.Toolbar.tipInsertTextart": "Insert Text Art",
|
"SSE.Views.Toolbar.tipInsertTextart": "Insert Text Art",
|
||||||
"SSE.Views.Toolbar.tipMerge": "Merge",
|
"SSE.Views.Toolbar.tipMerge": "Merge",
|
||||||
|
|
Loading…
Reference in a new issue