mirror of
https://github.com/farmOS/farmOS.git
synced 2024-02-23 11:37:38 +01:00
Only apply farm_theme_map_collapse JS behavior to fieldsets that contain a map.
This commit is contained in:
parent
e92be80c33
commit
b77da615a4
1 changed files with 9 additions and 7 deletions
|
@ -5,13 +5,15 @@
|
||||||
// If a map is inside a collapsed fieldset, update the map size when the
|
// If a map is inside a collapsed fieldset, update the map size when the
|
||||||
// fieldset is expanded.
|
// fieldset is expanded.
|
||||||
$('fieldset.collapsible', context).once('map-collapse', function (index, element) {
|
$('fieldset.collapsible', context).once('map-collapse', function (index, element) {
|
||||||
$(element).on('shown.bs.collapse', function () {
|
if ($('.farm-map', element).length) {
|
||||||
var mapId = $('.farm-map', element).attr('id');
|
$(element).on('shown.bs.collapse', function () {
|
||||||
var index = farmOS.map.targetIndex(mapId);
|
var mapId = $('.farm-map', element).attr('id');
|
||||||
if (index !== -1) {
|
var index = farmOS.map.targetIndex(mapId);
|
||||||
farmOS.map.instances[index].map.updateSize();
|
if (index !== -1) {
|
||||||
}
|
farmOS.map.instances[index].map.updateSize();
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue