File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change 44
44
45
45
latField . val ( latCoord ) ;
46
46
lngField . val ( lngCoord ) ;
47
- updateBounds ( ) ;
47
+ updateBounds ( init ) ;
48
48
49
+ // Mark form as changed if this isn't initialisation
49
50
if ( ! init ) {
50
- // Mark as changed(?)
51
51
$ ( '.cms-edit-form' ) . addClass ( 'changed' ) ;
52
52
}
53
53
}
54
54
55
- function updateZoom ( ) {
55
+ function updateZoom ( init ) {
56
56
zoomField . val ( map . getZoom ( ) ) ;
57
+ // Mark form as changed if this isn't initialisation
58
+ if ( ! init ) {
59
+ $ ( '.cms-edit-form' ) . addClass ( 'changed' ) ;
60
+ }
57
61
}
58
-
62
+
59
63
function updateBounds ( ) {
60
64
var bounds = JSON . stringify ( map . getBounds ( ) . toJSON ( ) ) ;
61
65
boundsField . val ( bounds ) ;
101
105
// Populate the fields to the current centre
102
106
google . maps . event . addListenerOnce ( map , 'idle' , function ( ) {
103
107
updateField ( map . getCenter ( ) , true ) ;
104
- updateZoom ( ) ;
108
+ updateZoom ( init ) ;
105
109
} ) ;
106
110
107
111
google . maps . event . addListener ( marker , 'dragend' , centreOnMarker ) ;
Original file line number Diff line number Diff line change @@ -108,24 +108,24 @@ public function setupChildren() {
108
108
$ name .'[Latitude] ' ,
109
109
'Lat ' ,
110
110
$ this ->recordFieldData ('Latitude ' )
111
- )->addExtraClass ('googlemapfield-latfield ' );
111
+ )->addExtraClass ('googlemapfield-latfield no-detect-changes ' );
112
112
113
113
$ this ->lngField = HiddenField::create (
114
114
$ name .'[Longitude] ' ,
115
115
'Lng ' ,
116
116
$ this ->recordFieldData ('Longitude ' )
117
- )->addExtraClass ('googlemapfield-lngfield ' );
117
+ )->addExtraClass ('googlemapfield-lngfield no-detect-changes ' );
118
118
119
119
$ this ->zoomField = HiddenField::create (
120
120
$ name .'[Zoom] ' ,
121
121
'Zoom ' ,
122
122
$ this ->recordFieldData ('Zoom ' )
123
- )->addExtraClass ('googlemapfield-zoomfield ' );
123
+ )->addExtraClass ('googlemapfield-zoomfield no-detect-changes ' );
124
124
$ this ->boundsField = HiddenField::create (
125
125
$ name .'[Bounds] ' ,
126
126
'Bounds ' ,
127
127
$ this ->recordFieldData ('Bounds ' )
128
- )->addExtraClass ('googlemapfield-boundsfield ' );
128
+ )->addExtraClass ('googlemapfield-boundsfield no-detect-changes ' );
129
129
$ this ->children = new FieldList (
130
130
$ this ->latField ,
131
131
$ this ->lngField ,
You can’t perform that action at this time.
0 commit comments