[PE][SSE] Change tooltip for custom bullet

This commit is contained in:
Julia Radzhabova 2022-05-13 00:07:26 +03:00
parent 0f883b3c4e
commit 5ab9ea3550
2 changed files with 32 additions and 6 deletions

View file

@ -503,6 +503,16 @@ define([
} }
}, },
updateBulletTip: function(view, title) {
if (view) {
var tip = $(view.el).data('bs.tooltip');
if (tip) {
tip.options.title = title;
tip.$tip.find('.tooltip-inner').text(title);
}
}
},
onApiBullets: function(v) { onApiBullets: function(v) {
if (this._state.bullets.type !== v.get_ListType() || this._state.bullets.subtype !== v.get_ListSubType() || v.get_ListType()===0 && v.get_ListSubType()===0x1000) { if (this._state.bullets.type !== v.get_ListType() || this._state.bullets.subtype !== v.get_ListSubType() || v.get_ListType()===0 && v.get_ListSubType()===0x1000) {
this._state.bullets.type = v.get_ListType(); this._state.bullets.type = v.get_ListType();
@ -526,8 +536,9 @@ define([
var symbol = bullet.asc_getChar(); var symbol = bullet.asc_getChar();
if (symbol) { if (symbol) {
rec.get('data').subtype = 0x1000; rec.get('data').subtype = 0x1000;
rec.set('tip', '');
rec.set('drawdata', {type: type, char: symbol, specialFont: bullet.asc_getSpecialFont()}); rec.set('drawdata', {type: type, char: symbol, specialFont: bullet.asc_getSpecialFont()});
rec.set('tip', '');
this.updateBulletTip(this.toolbar.mnuMarkersPicker.dataViewItems[8], '');
drawDefBullet = false; drawDefBullet = false;
idx = 8; idx = 8;
} }
@ -535,8 +546,9 @@ define([
var id = bullet.asc_getImageId(); var id = bullet.asc_getImageId();
if (id) { if (id) {
rec.get('data').subtype = 0x1000; rec.get('data').subtype = 0x1000;
rec.set('tip', '');
rec.set('drawdata', {type: type, imageId: id}); rec.set('drawdata', {type: type, imageId: id});
rec.set('tip', '');
this.updateBulletTip(this.toolbar.mnuMarkersPicker.dataViewItems[8], '');
drawDefBullet = false; drawDefBullet = false;
idx = 8; idx = 8;
} }
@ -581,8 +593,9 @@ define([
} }
if (drawDefBullet) { if (drawDefBullet) {
rec.get('data').subtype = 8; rec.get('data').subtype = 8;
rec.set('tip', this.toolbar.tipMarkersDash);
rec.set('drawdata', this.toolbar._markersArr[8]); rec.set('drawdata', this.toolbar._markersArr[8]);
rec.set('tip', this.toolbar.tipMarkersDash);
this.updateBulletTip(this.toolbar.mnuMarkersPicker.dataViewItems[8], this.toolbar.tipMarkersDash);
} }
} }
}, },

View file

@ -2141,8 +2141,9 @@ define([
if (symbol) { if (symbol) {
rec = defrec; rec = defrec;
rec.set('subtype', 0x1000); rec.set('subtype', 0x1000);
rec.set('tip', '');
rec.set('drawdata', {type: bullettype, char: symbol, specialFont: bullet.asc_getSpecialFont()}); rec.set('drawdata', {type: bullettype, char: symbol, specialFont: bullet.asc_getSpecialFont()});
rec.set('tip', '');
this.updateBulletTip(documentHolder.paraBulletsPicker.dataViewItems[7], '');
drawDefBullet = false; drawDefBullet = false;
} }
@ -2151,8 +2152,9 @@ define([
if (id) { if (id) {
rec = defrec; rec = defrec;
rec.set('subtype', 0x1000); rec.set('subtype', 0x1000);
rec.set('tip', '');
rec.set('drawdata', {type: bullettype, imageId: id}); rec.set('drawdata', {type: bullettype, imageId: id});
rec.set('tip', '');
this.updateBulletTip(documentHolder.paraBulletsPicker.dataViewItems[7], '');
drawDefBullet = false; drawDefBullet = false;
} }
} }
@ -2161,8 +2163,9 @@ define([
documentHolder.paraBulletsPicker.selectRecord(rec, true); documentHolder.paraBulletsPicker.selectRecord(rec, true);
if (drawDefBullet) { if (drawDefBullet) {
defrec.set('subtype', 8); defrec.set('subtype', 8);
defrec.set('tip', documentHolder.tipMarkersDash);
defrec.set('drawdata', documentHolder._markersArr[7]); defrec.set('drawdata', documentHolder._markersArr[7]);
defrec.set('tip', documentHolder.tipMarkersDash);
this.updateBulletTip(documentHolder.paraBulletsPicker.dataViewItems[7], documentHolder.tipMarkersDash);
} }
} 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();
@ -3827,6 +3830,16 @@ define([
} }
}, },
updateBulletTip: function(view, title) {
if (view) {
var tip = $(view.el).data('bs.tooltip');
if (tip) {
tip.options.title = title;
tip.$tip.find('.tooltip-inner').text(title);
}
}
},
onSignatureClick: function(item) { onSignatureClick: function(item) {
var datavalue = item.cmpEl.attr('data-value'); var datavalue = item.cmpEl.attr('data-value');
switch (item.value) { switch (item.value) {