未验证 提交 dca4f27c 编写于 作者: 智布道's avatar 智布道 👁 提交者: GitHub

Merge pull request #22 from linxuhong/master

issue :发布文章时,点击标签名,页面无法选择中对应的标签
......@@ -12,7 +12,7 @@ var editor = null, simplemde = null;
var zhyd = window.zhyd || {
combox: {
init: function () {
init: function (mockComboxCallback) {
$('select[target=combox]').each(function (e) {
var $this = $(this);
var url = $this.data("url");
......@@ -47,6 +47,10 @@ var zhyd = window.zhyd || {
var liTpl = '{{#data}}<li data-value="{{id}}">{{name}}</li>{{/data}}';
var html = Mustache.render(liTpl, json);
$this.html(html);
if ($.isFunction(mockComboxCallback)) {
mockComboxCallback();
}
}
}
});
......@@ -75,11 +79,13 @@ var zhyd = window.zhyd || {
function add() {
var thisId = $(this).data("value");
var thisText = $(this).text().trim();
console.log(thisText);
$this.tagsinput('add', {"id": thisId, "name": thisText}, {add: false});
}
$($bindBox).find("li").each(function () {
var $li = $(this);
console.log(222222)
$li.bind('click', add);
});
$(".bootstrap-tagsinput input").bind('keydown', function (event) {
......@@ -562,8 +568,7 @@ $(document).ready(function () {
});
}
});
zhyd.combox.init();
zhyd.tagsInput.init();
zhyd.combox.init(zhyd.tagsInput.init);
zhyd.mask.init();
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册