Skip to content

Commit

Permalink
fix: #83
Browse files Browse the repository at this point in the history
There is no changed Event in diffConfig, the bound event will be removed
  • Loading branch information
JserWang committed Jan 21, 2019
1 parent d412239 commit 1c0fce7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rc-bmap",
"version": "1.0.0",
"version": "1.0.1",
"main": "lib/index.js",
"repository": {
"type": "git",
Expand Down
9 changes: 2 additions & 7 deletions src/core/AutoComplete/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,9 @@ class AutoComplete {
this.init({ ...this.config, ...diffConfig });
} else {
this.processOptions(diffConfig);

if (config.events) {
this.processEvents(config.events);
}
}
this.config = { ...this.config, ...diffConfig };
this.processEvents(this.config.events);
}

destroy = () => {
Expand All @@ -56,9 +53,7 @@ class AutoComplete {

processEvents = (events) => {
Util.unbindEvents(this.instance);
if (events) {
Util.bindEvents(this.instance, events);
}
Util.bindEvents(this.instance, events);
}

processOptions(config) {
Expand Down
3 changes: 1 addition & 2 deletions src/core/Map/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,13 @@ class Map {
const diffConfig = Util.compareConfig(this.config, config);

this.processContextMenu(diffConfig.contextMenu);
this.processEvents(diffConfig.events);

this.setMapType(diffConfig.mapType);
this.processOptions(diffConfig);
this.config = {
...this.config,
...diffConfig,
};
this.processEvents(this.config.events);
}
}

Expand Down
5 changes: 1 addition & 4 deletions src/core/Overlay/BaseOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,9 @@ class BaseOverlay {
this.init({ ...this.config, ...diffConfig });
} else {
this.processOptions(diffConfig);

if (config.events) {
this.processEvents(config.events);
}
}
this.config = { ...this.config, ...diffConfig };
this.processEvents(this.config.events);
}

destroy = () => {
Expand Down

0 comments on commit 1c0fce7

Please sign in to comment.