Commit 8b7d463d authored by Maxim Kadushkin's avatar Maxim Kadushkin

[SSE mobile] refactoring

parent 0b5edaae
......@@ -185,20 +185,16 @@ define([
}];
} else {
var menuItems = [
{
var menuItems = [{
caption: 'Cut',
event: 'cut'
},
{
},{
caption: 'Copy',
event: 'copy'
},
{
},{
caption: 'Paste',
event: 'paste'
}
];
}];
var iscellmenu, isrowmenu, iscolmenu, isallmenu, ischartmenu, isimagemenu, istextshapemenu, isshapemenu, istextchartmenu,
seltype = cellinfo.asc_getFlags().asc_getSelectionType(),
......@@ -217,13 +213,13 @@ define([
case Asc.c_oAscSelectionType.RangeShapeText: istextshapemenu = true; break;
}
if (isimagemenu || isshapemenu || ischartmenu) {
if (isimagemenu || isshapemenu || ischartmenu ||
istextshapemenu || istextchartmenu )
{
menuItems.push({
caption: 'Edit',
event: 'edit'
});
} else
if (istextshapemenu || istextchartmenu) {
} else {
if ( iscolmenu || isrowmenu) {
menuItems.push({
......@@ -238,7 +234,6 @@ define([
});
} else
if ( iscellmenu ) {
!iscelledited &&
menuItems.push({
caption: 'Delete',
event: 'del'
......@@ -272,7 +267,7 @@ define([
event: 'wrap'
});
if ( cellinfo.asc_getHyperlink() && !iscelledited && !cellinfo.asc_getFlags().asc_getMultiselect() &&
if ( cellinfo.asc_getHyperlink() && !cellinfo.asc_getFlags().asc_getMultiselect() &&
cellinfo.asc_getHyperlink().asc_getType() == Asc.c_oAscHyperlinkType.WebLink )
{
menuItems.push({
......@@ -280,7 +275,7 @@ define([
event: 'openlink'
});
} else
if ( !cellinfo.asc_getHyperlink() && !iscelledited && !cellinfo.asc_getFlags().asc_getMultiselect() &&
if ( !cellinfo.asc_getHyperlink() && !cellinfo.asc_getFlags().asc_getMultiselect() &&
!cellinfo.asc_getFlags().asc_getLockText() && !!cellinfo.asc_getText() )
{
menuItems.push({
......
......@@ -426,13 +426,15 @@ define([
var opened = $('.document-menu.modal-in').length;
uiApp.closeModal('.document-menu.modal-in');
var newindex = model.get('index');
if ( newindex == this.api.asc_getActiveWorksheetIndex () ) {
var sdkindex = model.get('index');
if ( sdkindex == this.api.asc_getActiveWorksheetIndex () ) {
if ( !opened )
this.statusbar.showTabContextMenu(this._getTabMenuItems(), model);
} else {
this.api.asc_showWorksheet( newindex );
this.api.asc_showWorksheet( sdkindex );
this.statusbar.setActiveTab(index);
Common.NotificationCenter.trigger('sheet:active', sdkindex);
}
},
......
......@@ -80,6 +80,29 @@ define([
uiApp.closeModal();
me.api.asc_getCellInfo();
var iscellmenu, isrowmenu, iscolmenu, isallmenu, ischartmenu, isimagemenu, istextshapemenu, isshapemenu, istextchartmenu,
seltype = cellinfo.asc_getFlags().asc_getSelectionType(),
iscelllocked = cellinfo.asc_getLocked(),
isTableLocked = cellinfo.asc_getLockedTable()===true;
switch ( seltype ) {
case Asc.c_oAscSelectionType.RangeCells: iscellmenu = true; break;
case Asc.c_oAscSelectionType.RangeRow: isrowmenu = true; break;
case Asc.c_oAscSelectionType.RangeCol: iscolmenu = true; break;
case Asc.c_oAscSelectionType.RangeMax: isallmenu = true; break;
case Asc.c_oAscSelectionType.RangeImage: isimagemenu = true; break;
case Asc.c_oAscSelectionType.RangeShape: isshapemenu = true; break;
case Asc.c_oAscSelectionType.RangeChart: ischartmenu = true; break;
case Asc.c_oAscSelectionType.RangeChartText: istextchartmenu = true; break;
case Asc.c_oAscSelectionType.RangeShapeText: istextshapemenu = true; break;
}
if ( iscellmenu ) {}
else {
}
options = opts;
parentButton = !opts ? '#toolbar-add' : opts.button;
me._showByStack(Common.SharedSettings.get('phone'));
......
......@@ -45,13 +45,6 @@ define([
'use strict';
SSE.Controllers.AddOther = Backbone.Controller.extend(_.extend((function() {
var c_pageNumPosition = {
PAGE_NUM_POSITION_TOP: 0x01,
PAGE_NUM_POSITION_BOTTOM: 0x02,
PAGE_NUM_POSITION_RIGHT: 0,
PAGE_NUM_POSITION_LEFT: 1,
PAGE_NUM_POSITION_CENTER: 2
};
return {
models: [],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment