[SSE mobile] cutted down 'Add' options for image/chart/shape

This commit is contained in:
Maxim Kadushkin 2017-01-11 17:50:14 +03:00
parent ab34b226a6
commit 39c281684f
3 changed files with 52 additions and 21 deletions

View file

@ -86,27 +86,29 @@ define([
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 ( !iscelllocked ) {
options = opts;
if ( !options ) {
switch (seltype) {
case Asc.c_oAscSelectionType.RangeCells:
case Asc.c_oAscSelectionType.RangeRow:
case Asc.c_oAscSelectionType.RangeCol:
case Asc.c_oAscSelectionType.RangeMax: break;
case Asc.c_oAscSelectionType.RangeImage:
case Asc.c_oAscSelectionType.RangeShape:
case Asc.c_oAscSelectionType.RangeChart:
case Asc.c_oAscSelectionType.RangeChartText:
case Asc.c_oAscSelectionType.RangeShapeText:
options = {panels: ['image','shape']};
break;
}
}
parentButton = !opts || !opts.button ? '#toolbar-add' : opts.button;
me._showByStack(Common.SharedSettings.get('phone'));
}
if ( iscellmenu ) {}
else {
}
options = opts;
parentButton = !opts || !opts.button ? '#toolbar-add' : opts.button;
me._showByStack(Common.SharedSettings.get('phone'));
this.api.asc_closeCellEditor();
SSE.getController('Toolbar').getView('Toolbar').hideSearch();
},
@ -139,7 +141,7 @@ define([
});
}
if ( !options )
if ( !options || !(_.indexOf(options.panels, 'shape') < 0) )
addViews.push({
caption: me.textShape,
id: 'add-shape',
@ -162,6 +164,14 @@ define([
});
}
if ( options && !(_.indexOf(options.panels, 'image')) ) {
addViews.push({
caption: 'Image',
id: 'add-image',
layout: SSE.getController('AddOther').getView('AddOther').childLayout('image')
});
}
return addViews;
},

View file

@ -78,7 +78,10 @@ define([
this.createView('AddOther').render();
},
initEvents: function () {
initEvents: function (args) {
if ( args && !(_.indexOf(args.panels, 'image') < 0) ) {
this.onPageShow(this.getView('AddOther'), '#addother-insimage');
}
},
onPageShow: function (view, pageId) {
@ -87,6 +90,15 @@ define([
if (pageId == '#addother-sort') {
var filterInfo = me.api.asc_getCellInfo().asc_getAutoFilterInfo();
view.optionAutofilter( filterInfo ? filterInfo.asc_getIsAutoFilter() : null)
} else
if (pageId == '#addother-insimage') {
$('#addimage-url').single('click', function(e) {
view.showImageFromUrl();
});
$('#addimage-file').single('click', function () {
me.onInsertImage({islocal:true});
});
}
},

View file

@ -132,6 +132,15 @@ define([
return '';
},
childLayout: function (name) {
if (this.layout) {
if ( name == 'image' )
return this.layout.find('#addother-insimage .page-content').html();
}
return '';
},
initControls: function () {
//
},