Skip to content

Commit 5f3e81d

Browse files
committed
Merge pull request ArcBees#6 from ArcBees/jd_fix_destroy
on destroy, remove the data related to the plugin
2 parents 5a3f766 + c70fc7e commit 5f3e81d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

elastic/src/main/java/com/arcbees/gquery/elastic/client/Elastic.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public Elastic elastic() {
4747
public Elastic elastic(ElasticOption options) {
4848
for (Element e : elements()) {
4949
GQuery $e = $(e);
50-
if (isSupported() && $e.data(ELASTIC_DATA_KEY) == null) {
50+
if (isSupported() && getImpl(e) == null) {
5151
ElasticImpl impl = new ElasticImpl(e, options);
5252
$e.data(ELASTIC_DATA_KEY, impl);
5353
}
@@ -60,6 +60,7 @@ public Elastic destroy() {
6060
ElasticImpl impl = getImpl(e);
6161
if (impl != null) {
6262
impl.destroy();
63+
$(e).removeData(ELASTIC_DATA_KEY);
6364
}
6465
}
6566
return this;

elastic/src/main/java/com/arcbees/gquery/elastic/client/ElasticImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public int compare(Integer col1, Integer col2) {
9999

100100
private Element container;
101101
private LayoutCommand layoutCommand;
102-
// Deque interface not supported by gwt
102+
// Deque interfaces not supported by gwt
103103
private PriorityQueue<Integer> columnPriorities;
104104
private List<Double> columnHeights;
105105
private boolean useTranslate3d;

0 commit comments

Comments
 (0)