You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by wa...@apache.org on 2020/10/15 13:47:53 UTC

[incubator-echarts] branch fix/toolbox created (now 560e2ea)

This is an automated email from the ASF dual-hosted git repository.

wangzx pushed a change to branch fix/toolbox
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git.


      at 560e2ea  fix(toolbox): fix incorrect `currentType` in `magictypechanged` event, close #12359.

This branch includes the following new commits:

     new 560e2ea  fix(toolbox): fix incorrect `currentType` in `magictypechanged` event, close #12359.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[incubator-echarts] 01/01: fix(toolbox): fix incorrect `currentType` in `magictypechanged` event, close #12359.

Posted by wa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

wangzx pushed a commit to branch fix/toolbox
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git

commit 560e2ea0d6c8a0beb39deccd1c3e48d3a8ec759e
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Thu Oct 15 21:39:46 2020 +0800

    fix(toolbox): fix incorrect `currentType` in `magictypechanged` event, close #12359.
---
 src/component/toolbox/feature/MagicType.ts | 9 +++++++--
 test/toolbox-stack-custom.html             | 3 +++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/component/toolbox/feature/MagicType.ts b/src/component/toolbox/feature/MagicType.ts
index cc2bd60..a3e86a4 100644
--- a/src/component/toolbox/feature/MagicType.ts
+++ b/src/component/toolbox/feature/MagicType.ts
@@ -155,6 +155,7 @@ class MagicType extends ToolboxFeature<ToolboxMagicTypeFeatureOption> {
         );
 
         let newTitle;
+        let currentType = type as TitleType;
         // Change title of stack
         if (type === 'stack') {
             // use titles in model instead of ecModel
@@ -163,12 +164,16 @@ class MagicType extends ToolboxFeature<ToolboxMagicTypeFeatureOption> {
             newTitle = zrUtil.merge({
                 stack: model.option.title.tiled,
                 tiled: model.option.title.stack
-            }, model.option.title)
+            }, model.option.title);
+
+            if (model.get(['iconStatus', type]) !== 'emphasis') {
+                currentType = 'tiled';
+            }
         }
 
         api.dispatchAction({
             type: 'changeMagicType',
-            currentType: type,
+            currentType: currentType,
             newOption: newOption,
             newTitle: newTitle,
             featureName: 'magicType'
diff --git a/test/toolbox-stack-custom.html b/test/toolbox-stack-custom.html
index ad54279..d898d6c 100644
--- a/test/toolbox-stack-custom.html
+++ b/test/toolbox-stack-custom.html
@@ -132,6 +132,9 @@ under the License.
 
             chart.setOption(option, true);
 
+            chart.on('magictypechanged', function (e) {
+                console.log('currentType is', e.currentType);
+            });
         });
     </script>
     <script>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org