Commit 70694ac1 authored by Julia Radzhabova's avatar Julia Radzhabova

[SSE] Apply bullets and numbering to text in shape.

[SSE] Apply list type to text in shape.
parent 70c2a58b
...@@ -110,6 +110,7 @@ function patchDropDownKeyDown(e) { ...@@ -110,6 +110,7 @@ function patchDropDownKeyDown(e) {
_.delay(function() { _.delay(function() {
var mnu = $('> [role=menu]', li), var mnu = $('> [role=menu]', li),
$subitems = mnu.find('> li:not(.divider):not(.disabled):visible > a'), $subitems = mnu.find('> li:not(.divider):not(.disabled):visible > a'),
$dataviews = mnu.find('> li:not(.divider):not(.disabled):visible .dataview'),
focusIdx = 0; focusIdx = 0;
if (mnu.find('> .menu-scroll').length>0) { if (mnu.find('> .menu-scroll').length>0) {
var offset = mnu.scrollTop(); var offset = mnu.scrollTop();
...@@ -119,7 +120,7 @@ function patchDropDownKeyDown(e) { ...@@ -119,7 +120,7 @@ function patchDropDownKeyDown(e) {
} }
} }
} }
if ($subitems.length>0) if ($subitems.length>0 && $dataviews.length<1)
$subitems.eq(focusIdx).focus(); $subitems.eq(focusIdx).focus();
}, 250); }, 250);
} }
......
...@@ -78,11 +78,6 @@ ...@@ -78,11 +78,6 @@
z-index: @zindex-tooltip + 1; z-index: @zindex-tooltip + 1;
} }
.menu-markers,
.menu-numbers {
//
}
.item-markerlist { .item-markerlist {
.background-ximage('@{app-image-path}/toolbar/bullets-and-numbering.png', '@{app-image-path}/toolbar/bullets-and-numbering@2x.png', 38px); .background-ximage('@{app-image-path}/toolbar/bullets-and-numbering.png', '@{app-image-path}/toolbar/bullets-and-numbering@2x.png', 38px);
width: 38px; width: 38px;
......
...@@ -179,6 +179,7 @@ define([ ...@@ -179,6 +179,7 @@ define([
view.imgMenu.on('item:click', _.bind(me.onImgMenu, me)); view.imgMenu.on('item:click', _.bind(me.onImgMenu, me));
view.menuParagraphVAlign.menu.on('item:click', _.bind(me.onParagraphVAlign, me)); view.menuParagraphVAlign.menu.on('item:click', _.bind(me.onParagraphVAlign, me));
view.menuParagraphDirection.menu.on('item:click', _.bind(me.onParagraphDirection, me)); view.menuParagraphDirection.menu.on('item:click', _.bind(me.onParagraphDirection, me));
view.menuParagraphBullets.menu.on('item:click', _.bind(me.onSelectNoneBullet, me));
view.menuAddHyperlinkShape.on('click', _.bind(me.onInsHyperlink, me)); view.menuAddHyperlinkShape.on('click', _.bind(me.onInsHyperlink, me));
view.menuEditHyperlinkShape.on('click', _.bind(me.onInsHyperlink, me)); view.menuEditHyperlinkShape.on('click', _.bind(me.onInsHyperlink, me));
view.menuRemoveHyperlinkShape.on('click', _.bind(me.onRemoveHyperlinkShape, me)); view.menuRemoveHyperlinkShape.on('click', _.bind(me.onRemoveHyperlinkShape, me));
...@@ -186,6 +187,7 @@ define([ ...@@ -186,6 +187,7 @@ define([
view.mnuShapeAdvanced.on('click', _.bind(me.onShapeAdvanced, me)); view.mnuShapeAdvanced.on('click', _.bind(me.onShapeAdvanced, me));
view.mnuChartEdit.on('click', _.bind(me.onChartEdit, me)); view.mnuChartEdit.on('click', _.bind(me.onChartEdit, me));
view.mnuImgAdvanced.on('click', _.bind(me.onImgAdvanced, me)); view.mnuImgAdvanced.on('click', _.bind(me.onImgAdvanced, me));
view.textInShapeMenu.on('render:after', _.bind(me.onTextInShapeAfterRender, me));
var documentHolderEl = view.cmpEl; var documentHolderEl = view.cmpEl;
...@@ -643,6 +645,39 @@ define([ ...@@ -643,6 +645,39 @@ define([
} }
}, },
onSelectNoneBullet: function(menu, item) {
if (this.api && item.options.value == -1) {
this.api.asc_setListType(item.options.value);
Common.NotificationCenter.trigger('edit:complete', this.documentHolder);
Common.component.Analytics.trackEvent('DocumentHolder', 'List Type');
}
},
onSelectBullets: function(picker, itemView, record, e) {
var rawData = {},
isPickerSelect = _.isFunction(record.toJSON);
if (isPickerSelect){
if (record.get('selected')) {
rawData = record.toJSON();
} else {
// record deselected
return;
}
} else {
rawData = record;
}
if (this.api)
this.api.asc_setListType(rawData.type, rawData.subtype);
if (e.type !== 'click')
this.documentHolder.textInShapeMenu.hide();
Common.NotificationCenter.trigger('edit:complete', this.documentHolder);
Common.component.Analytics.trackEvent('DocumentHolder', 'List Type');
},
onRemoveHyperlinkShape: function(item) { onRemoveHyperlinkShape: function(item) {
if (this.api) { if (this.api) {
this.api.asc_removeHyperlink(); this.api.asc_removeHyperlink();
...@@ -1266,7 +1301,8 @@ define([ ...@@ -1266,7 +1301,8 @@ define([
if (elType == Asc.c_oAscTypeSelectElement.Image) { if (elType == Asc.c_oAscTypeSelectElement.Image) {
var value = selectedObjects[i].asc_getObjectValue(), var value = selectedObjects[i].asc_getObjectValue(),
align = value.asc_getVerticalTextAlign(), align = value.asc_getVerticalTextAlign(),
direct = value.asc_getVert(); direct = value.asc_getVert(),
listtype = this.api.asc_getCurrentListType();
isObjLocked = isObjLocked || value.asc_getLocked(); isObjLocked = isObjLocked || value.asc_getLocked();
documentHolder.menuParagraphTop.setChecked(align == Asc.c_oAscVAlign.Top); documentHolder.menuParagraphTop.setChecked(align == Asc.c_oAscVAlign.Top);
documentHolder.menuParagraphCenter.setChecked(align == Asc.c_oAscVAlign.Center); documentHolder.menuParagraphCenter.setChecked(align == Asc.c_oAscVAlign.Center);
...@@ -1275,6 +1311,10 @@ define([ ...@@ -1275,6 +1311,10 @@ define([
documentHolder.menuParagraphDirectH.setChecked(direct == Asc.c_oAscVertDrawingText.normal); documentHolder.menuParagraphDirectH.setChecked(direct == Asc.c_oAscVertDrawingText.normal);
documentHolder.menuParagraphDirect90.setChecked(direct == Asc.c_oAscVertDrawingText.vert); documentHolder.menuParagraphDirect90.setChecked(direct == Asc.c_oAscVertDrawingText.vert);
documentHolder.menuParagraphDirect270.setChecked(direct == Asc.c_oAscVertDrawingText.vert270); documentHolder.menuParagraphDirect270.setChecked(direct == Asc.c_oAscVertDrawingText.vert270);
documentHolder.menuParagraphBulletNone.setChecked(listtype.get_ListType() == -1);
var rec = documentHolder.paraBulletsPicker.store.findWhere({ type: listtype.get_ListType(), subtype: listtype.get_ListSubType() });
documentHolder.paraBulletsPicker.selectRecord(rec, true);
} else if (elType == Asc.c_oAscTypeSelectElement.Paragraph) { } else if (elType == Asc.c_oAscTypeSelectElement.Paragraph) {
documentHolder.pmiTextAdvanced.textInfo = selectedObjects[i].asc_getObjectValue(); documentHolder.pmiTextAdvanced.textInfo = selectedObjects[i].asc_getObjectValue();
isObjLocked = isObjLocked || documentHolder.pmiTextAdvanced.textInfo.asc_getLocked(); isObjLocked = isObjLocked || documentHolder.pmiTextAdvanced.textInfo.asc_getLocked();
...@@ -2338,7 +2378,20 @@ define([ ...@@ -2338,7 +2378,20 @@ define([
Common.NotificationCenter.trigger('edit:complete', me.documentHolder); Common.NotificationCenter.trigger('edit:complete', me.documentHolder);
}, },
guestText : 'Guest', onTextInShapeAfterRender:function(cmp) {
var view = this.documentHolder,
_conf = view.paraBulletsPicker.conf;
view.paraBulletsPicker = new Common.UI.DataView({
el : $('#id-docholder-menu-bullets'),
parentMenu : view.menuParagraphBullets.menu,
store : view.paraBulletsPicker.store,
itemTemplate: _.template('<div id="<%= id %>" class="item-markerlist" style="background-position: 0 -<%= offsety %>px;"></div>')
});
view.paraBulletsPicker.on('item:click', _.bind(this.onSelectBullets, this));
_conf && view.paraBulletsPicker.selectRecord(_conf.rec, true);
},
guestText : 'Guest',
textCtrlClick : 'Press CTRL and click link', textCtrlClick : 'Press CTRL and click link',
txtHeight : 'Height', txtHeight : 'Height',
txtWidth : 'Width', txtWidth : 'Width',
......
...@@ -538,6 +538,45 @@ define([ ...@@ -538,6 +538,45 @@ define([
}) })
}); });
me.menuParagraphBullets = new Common.UI.MenuItem({
caption : me.bulletsText,
menu : new Common.UI.Menu({
menuAlign: 'tl-tr',
items : [
{ template: _.template('<div id="id-docholder-menu-bullets" class="menu-layouts" style="width: 325px; margin: 0 4px;"></div>') },
{caption: '--'},
me.menuParagraphBulletNone = new Common.UI.MenuItem({
caption : me.textNone,
checkable : true,
checked : false,
value : -1
})
]
})
});
me.paraBulletsPicker = {
conf: {rec: null},
store : new Common.UI.DataViewStore([
{offsety: 38, type: 0, subtype: 1},
{offsety: 76, type: 0, subtype: 2},
{offsety: 114, type: 0, subtype: 3},
{offsety: 152, type: 0, subtype: 4},
{offsety: 190, type: 0, subtype: 5},
{offsety: 228, type: 0, subtype: 6},
{offsety: 266, type: 0, subtype: 7},
{offsety: 570, type: 1, subtype: 4},
{offsety: 532, type: 1, subtype: 5},
{offsety: 608, type: 1, subtype: 6},
{offsety: 418, type: 1, subtype: 1},
{offsety: 456, type: 1, subtype: 2},
{offsety: 494, type: 1, subtype: 3},
{offsety: 646, type: 1, subtype: 7}
]),
selectRecord: function (rec) {
this.conf.rec = rec;
}
};
me.menuAddHyperlinkShape = new Common.UI.MenuItem({ me.menuAddHyperlinkShape = new Common.UI.MenuItem({
caption : me.txtInsHyperlink caption : me.txtInsHyperlink
}); });
...@@ -588,6 +627,7 @@ define([ ...@@ -588,6 +627,7 @@ define([
{caption: '--'}, {caption: '--'},
me.menuParagraphVAlign, me.menuParagraphVAlign,
me.menuParagraphDirection, me.menuParagraphDirection,
me.menuParagraphBullets,
me.menuAddHyperlinkShape, me.menuAddHyperlinkShape,
me.menuHyperlinkShape, me.menuHyperlinkShape,
{caption: '--'}, {caption: '--'},
...@@ -712,7 +752,9 @@ define([ ...@@ -712,7 +752,9 @@ define([
txtClearSparklines: 'Clear Selected Sparklines', txtClearSparklines: 'Clear Selected Sparklines',
txtClearSparklineGroups: 'Clear Selected Sparkline Groups', txtClearSparklineGroups: 'Clear Selected Sparkline Groups',
txtShowComment: 'Show Comment', txtShowComment: 'Show Comment',
advancedImgText: 'Image Advanced Settings' advancedImgText: 'Image Advanced Settings',
textNone: 'None',
bulletsText: 'Bullets and Numbering'
}, SSE.Views.DocumentHolder || {})); }, SSE.Views.DocumentHolder || {}));
}); });
\ No newline at end of file
...@@ -1020,6 +1020,8 @@ ...@@ -1020,6 +1020,8 @@
"SSE.Views.DocumentHolder.txtUngroup": "Ungroup", "SSE.Views.DocumentHolder.txtUngroup": "Ungroup",
"SSE.Views.DocumentHolder.txtWidth": "Width", "SSE.Views.DocumentHolder.txtWidth": "Width",
"SSE.Views.DocumentHolder.vertAlignText": "Vertical Alignment", "SSE.Views.DocumentHolder.vertAlignText": "Vertical Alignment",
"SSE.Views.DocumentHolder.textNone": "None",
"SSE.Views.DocumentHolder.bulletsText": "Bullets and Numbering",
"SSE.Views.FileMenu.btnBackCaption": "Go to Documents", "SSE.Views.FileMenu.btnBackCaption": "Go to Documents",
"SSE.Views.FileMenu.btnCloseMenuCaption": "Close Menu", "SSE.Views.FileMenu.btnCloseMenuCaption": "Close Menu",
"SSE.Views.FileMenu.btnCreateNewCaption": "Create New", "SSE.Views.FileMenu.btnCreateNewCaption": "Create New",
......
...@@ -265,4 +265,10 @@ ...@@ -265,4 +265,10 @@
z-index: @zindex-dropdown - 20; z-index: @zindex-dropdown - 20;
background-color: @gray-light; background-color: @gray-light;
border: 1px solid @gray; border: 1px solid @gray;
}
.item-markerlist {
.background-ximage('@{app-image-path}/toolbar/bullets-and-numbering.png', '@{app-image-path}/toolbar/bullets-and-numbering@2x.png', 38px);
width: 38px;
height: 38px;
} }
\ No newline at end of file
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