tts
This commit is contained in:
parent
eaf37bfe5e
commit
9dcfda0cb9
|
|
@ -60,27 +60,16 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts','echarts-th
|
|||
|
||||
setTimeout(function () {
|
||||
var $city = $('#select_city');
|
||||
if (!$city.data('citypicker')) {
|
||||
$city.citypicker();
|
||||
if ($city.data('citypicker')) {
|
||||
$city.citypicker('destroy');
|
||||
}
|
||||
$city.citypicker();
|
||||
|
||||
$city.off("cp:updated").on("cp:updated", function () {
|
||||
var citypicker = $(this).data("citypicker");
|
||||
var code = citypicker.getCode("district") || citypicker.getCode("city") || citypicker.getCode("province");
|
||||
$("#select_area_id").val(code);
|
||||
});
|
||||
|
||||
// 手动调整dropdown位置,确保它跟输入框对齐
|
||||
var $dropdown = $('.city-picker-dropdown');
|
||||
if ($dropdown.length) {
|
||||
var offset = $city.offset();
|
||||
$dropdown.css({
|
||||
top: offset.top + $city.outerHeight() + 2, // +2像素做一点距离
|
||||
left: offset.left,
|
||||
display: 'block',
|
||||
position: 'absolute',
|
||||
'z-index': 9999
|
||||
});
|
||||
}
|
||||
}, 500);
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user