Skip to content

Commit dca6cf7

Browse files
xiaochen-dbXiao Chen
andauthored
Move _dragging from model value to attribute (#997)
* move _dragging from model value to attribute * initialize _dragging at initialize() * nit Co-authored-by: Xiao Chen <[email protected]>
1 parent 3437521 commit dca6cf7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

js/src/Map.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,18 @@ export class LeafletMapModel extends widgets.DOMWidgetModel {
8282
style: null,
8383
default_style: null,
8484
dragging_style: null,
85-
_dragging: false
8685
};
8786
}
8887

8988
initialize(attributes, options) {
9089
super.initialize(attributes, options);
9190
this.set('window_url', window.location.href);
91+
this._dragging = false
9292
}
9393

9494
update_style() {
9595
var new_style;
96-
if (!this.get('_dragging')) {
96+
if (!this._dragging) {
9797
new_style = this.get('default_style');
9898
} else {
9999
new_style = this.get('dragging_style');
@@ -264,12 +264,12 @@ export class LeafletMapView extends utils.LeafletDOMWidgetView {
264264
this.model.update_bounds().then(() => {
265265
this.touch();
266266
});
267-
this.model.set('_dragging', false);
267+
this.model._dragging = false;
268268
this.model.update_style();
269269
});
270270

271271
this.obj.on('movestart', () => {
272-
this.model.set('_dragging', true);
272+
this.model._dragging = true;
273273
this.model.update_style();
274274
});
275275

0 commit comments

Comments
 (0)