From 5ab9ea3550e0995174ae09b4c7d590cfb616f749 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 13 May 2022 00:07:26 +0300 Subject: [PATCH] [PE][SSE] Change tooltip for custom bullet --- .../main/app/controller/Toolbar.js | 19 ++++++++++++++++--- .../main/app/controller/DocumentHolder.js | 19 ++++++++++++++++--- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index b59c6d254..87acd7754 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -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) { 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(); @@ -526,8 +536,9 @@ define([ var symbol = bullet.asc_getChar(); if (symbol) { rec.get('data').subtype = 0x1000; - rec.set('tip', ''); rec.set('drawdata', {type: type, char: symbol, specialFont: bullet.asc_getSpecialFont()}); + rec.set('tip', ''); + this.updateBulletTip(this.toolbar.mnuMarkersPicker.dataViewItems[8], ''); drawDefBullet = false; idx = 8; } @@ -535,8 +546,9 @@ define([ var id = bullet.asc_getImageId(); if (id) { rec.get('data').subtype = 0x1000; - rec.set('tip', ''); rec.set('drawdata', {type: type, imageId: id}); + rec.set('tip', ''); + this.updateBulletTip(this.toolbar.mnuMarkersPicker.dataViewItems[8], ''); drawDefBullet = false; idx = 8; } @@ -581,8 +593,9 @@ define([ } if (drawDefBullet) { rec.get('data').subtype = 8; - rec.set('tip', this.toolbar.tipMarkersDash); rec.set('drawdata', this.toolbar._markersArr[8]); + rec.set('tip', this.toolbar.tipMarkersDash); + this.updateBulletTip(this.toolbar.mnuMarkersPicker.dataViewItems[8], this.toolbar.tipMarkersDash); } } }, diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index ff5dd4956..121d75dd2 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -2141,8 +2141,9 @@ define([ if (symbol) { rec = defrec; rec.set('subtype', 0x1000); - rec.set('tip', ''); rec.set('drawdata', {type: bullettype, char: symbol, specialFont: bullet.asc_getSpecialFont()}); + rec.set('tip', ''); + this.updateBulletTip(documentHolder.paraBulletsPicker.dataViewItems[7], ''); drawDefBullet = false; } @@ -2151,8 +2152,9 @@ define([ if (id) { rec = defrec; rec.set('subtype', 0x1000); - rec.set('tip', ''); rec.set('drawdata', {type: bullettype, imageId: id}); + rec.set('tip', ''); + this.updateBulletTip(documentHolder.paraBulletsPicker.dataViewItems[7], ''); drawDefBullet = false; } } @@ -2161,8 +2163,9 @@ define([ documentHolder.paraBulletsPicker.selectRecord(rec, true); if (drawDefBullet) { defrec.set('subtype', 8); - defrec.set('tip', documentHolder.tipMarkersDash); 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) { 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) { var datavalue = item.cmpEl.attr('data-value'); switch (item.value) {