Fixed #568: mode switcher disappearing when selecting the current mode again

This commit is contained in:
jos 2018-08-24 20:24:12 +02:00
parent 1a99acd36d
commit 5ca264d037
2 changed files with 6 additions and 2 deletions

View File

@ -3,6 +3,12 @@
https://github.com/josdejong/jsoneditor https://github.com/josdejong/jsoneditor
## not yet released, version 5.24.1
- Fixed #568: mode switcher disappearing when selecting the current
mode again.
## 2018-08-22, version 5.24.0 ## 2018-08-22, version 5.24.0
- Implemented a color picker, and allow hooking in a custom color - Implemented a color picker, and allow hooking in a custom color

View File

@ -1043,8 +1043,6 @@ treemode._createFrame = function () {
if (this.options && this.options.modes && this.options.modes.length) { if (this.options && this.options.modes && this.options.modes.length) {
var me = this; var me = this;
this.modeSwitcher = new ModeSwitcher(this.menu, this.options.modes, this.options.mode, function onSwitch(mode) { this.modeSwitcher = new ModeSwitcher(this.menu, this.options.modes, this.options.mode, function onSwitch(mode) {
me.modeSwitcher.destroy();
// switch mode and restore focus // switch mode and restore focus
me.setMode(mode); me.setMode(mode);
me.modeSwitcher.focus(); me.modeSwitcher.focus();