diff --git a/bricks/toolbar.js b/bricks/toolbar.js index ccc1c5a..03a8abc 100755 --- a/bricks/toolbar.js +++ b/bricks/toolbar.js @@ -78,6 +78,7 @@ bricks.Toolbar = class extends bricks.Layout { } remove_item(w, event){ this.bar.remove_widget(w); + this.bar.unselect_item(w); this.toolList.remove(w); w.unbind('click',this.do_handle.bind(this, w)); this.dispatch('remove', w.tool_opts); @@ -92,6 +93,7 @@ bricks.Toolbar = class extends bricks.Layout { if (this.opts.target){ d.target = this.opts.target; } + this.bar.select_item(tool); this.dispatch('command', d); this.dispatch(tool.tool_opts.name, d); bricks.debug('event ', tool.tool_opts.name, ' fired ...')