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

[SSE mobile] refactoring

parent 0b5edaae
...@@ -185,20 +185,16 @@ define([ ...@@ -185,20 +185,16 @@ define([
}]; }];
} else { } else {
var menuItems = [ var menuItems = [{
{
caption: 'Cut', caption: 'Cut',
event: 'cut' event: 'cut'
}, },{
{
caption: 'Copy', caption: 'Copy',
event: 'copy' event: 'copy'
}, },{
{
caption: 'Paste', caption: 'Paste',
event: 'paste' event: 'paste'
} }];
];
var iscellmenu, isrowmenu, iscolmenu, isallmenu, ischartmenu, isimagemenu, istextshapemenu, isshapemenu, istextchartmenu, var iscellmenu, isrowmenu, iscolmenu, isallmenu, ischartmenu, isimagemenu, istextshapemenu, isshapemenu, istextchartmenu,
seltype = cellinfo.asc_getFlags().asc_getSelectionType(), seltype = cellinfo.asc_getFlags().asc_getSelectionType(),
...@@ -217,13 +213,13 @@ define([ ...@@ -217,13 +213,13 @@ define([
case Asc.c_oAscSelectionType.RangeShapeText: istextshapemenu = true; break; case Asc.c_oAscSelectionType.RangeShapeText: istextshapemenu = true; break;
} }
if (isimagemenu || isshapemenu || ischartmenu) { if (isimagemenu || isshapemenu || ischartmenu ||
istextshapemenu || istextchartmenu )
{
menuItems.push({ menuItems.push({
caption: 'Edit', caption: 'Edit',
event: 'edit' event: 'edit'
}); });
} else
if (istextshapemenu || istextchartmenu) {
} else { } else {
if ( iscolmenu || isrowmenu) { if ( iscolmenu || isrowmenu) {
menuItems.push({ menuItems.push({
...@@ -238,7 +234,6 @@ define([ ...@@ -238,7 +234,6 @@ define([
}); });
} else } else
if ( iscellmenu ) { if ( iscellmenu ) {
!iscelledited &&
menuItems.push({ menuItems.push({
caption: 'Delete', caption: 'Delete',
event: 'del' event: 'del'
...@@ -272,7 +267,7 @@ define([ ...@@ -272,7 +267,7 @@ define([
event: 'wrap' 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 ) cellinfo.asc_getHyperlink().asc_getType() == Asc.c_oAscHyperlinkType.WebLink )
{ {
menuItems.push({ menuItems.push({
...@@ -280,7 +275,7 @@ define([ ...@@ -280,7 +275,7 @@ define([
event: 'openlink' event: 'openlink'
}); });
} else } 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() ) !cellinfo.asc_getFlags().asc_getLockText() && !!cellinfo.asc_getText() )
{ {
menuItems.push({ menuItems.push({
......
...@@ -426,13 +426,15 @@ define([ ...@@ -426,13 +426,15 @@ define([
var opened = $('.document-menu.modal-in').length; var opened = $('.document-menu.modal-in').length;
uiApp.closeModal('.document-menu.modal-in'); uiApp.closeModal('.document-menu.modal-in');
var newindex = model.get('index'); var sdkindex = model.get('index');
if ( newindex == this.api.asc_getActiveWorksheetIndex () ) { if ( sdkindex == this.api.asc_getActiveWorksheetIndex () ) {
if ( !opened ) if ( !opened )
this.statusbar.showTabContextMenu(this._getTabMenuItems(), model); this.statusbar.showTabContextMenu(this._getTabMenuItems(), model);
} else { } else {
this.api.asc_showWorksheet( newindex ); this.api.asc_showWorksheet( sdkindex );
this.statusbar.setActiveTab(index); this.statusbar.setActiveTab(index);
Common.NotificationCenter.trigger('sheet:active', sdkindex);
} }
}, },
......
...@@ -80,6 +80,29 @@ define([ ...@@ -80,6 +80,29 @@ define([
uiApp.closeModal(); 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; options = opts;
parentButton = !opts ? '#toolbar-add' : opts.button; parentButton = !opts ? '#toolbar-add' : opts.button;
me._showByStack(Common.SharedSettings.get('phone')); me._showByStack(Common.SharedSettings.get('phone'));
......
...@@ -45,13 +45,6 @@ define([ ...@@ -45,13 +45,6 @@ define([
'use strict'; 'use strict';
SSE.Controllers.AddOther = Backbone.Controller.extend(_.extend((function() { 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 { return {
models: [], 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