{% block addTag %}
    <style>
        .table td {
            text-align: center;
        }
    </style>
    <!-- 房源特色出层 -->
    <div class="modal fade" id="houseFeature" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document" style="position: absolute;top: 0;bottom: 0;left: 0;right: 0;	margin: auto;height: 200px;overflow-y: auto;overflow-x: hidden;">
            <div class="modal-content">
                <div class="row" id="featureTable">
                    <div class="col-md-12">
                        <table class="table" id="tagList">
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script>
        var search_type;
        var search_callback;
        var tagList;
        $(document).ready(function () {
            tagList = $('#tagList');
            $("#houseFeature").on("show.bs.modal", function () {
                tagList.html('');
                $.ajax({
                    type: "POST",
                    url: "/tospur/wp-admin/admin-ajax.php",
                    data: "action=searchTagOrFeature&type=" + search_type,
                    success: function (data) {
                        var tr;
                        $.each(data, function (index, item) {
                            if (index % 4 == 0) {
                                tr = $('<tr>');
                            }
                            tr.append('<td id="' + item.id + '">' + item.value + '</td>');
                            tagList.append(tr);
                        });
                    }
                });
            });
            tagList.on("click", "tr > td", function () {
                search_callback($(this).attr('id'), $(this).text());
            });
            existsCancel();
        });
        function init_modal_addTag(type, callback) {
            search_type = type;
            search_callback = callback;
            $('#houseFeature').modal('show');
        }
    </script>
{% endblock %}