Authored by 姜敏

品类显示展开bug

... ... @@ -45,7 +45,7 @@
</script>
<script type="text/template" id="tableTemp2">
<span class="folder"></span>
<span class="folder" data-name="[[isRefundExchange]]"></span>
<span style="width: 5%">[[id]]</span>
<span style="width: 20%">[[sortName]]</span>
<span>[[sortLevel]]级分类</span>
... ... @@ -58,14 +58,11 @@
[[/if]]
</span>
<span class="operate" data-id="[[id]]" data-name="[[sortName]]">
[[if isok]]
[[else]]
[[if isRefundExchange=="1"]]
<a class="btn btn-danger btn-sm close-category " style="width:50px" href="javascript:;"></a>
[[/if]]
[[if isRefundExchange=="0"]]
<a class="btn btn-warning btn-sm open-category " style="width:50px" href="javascript:;"></a>
[[/if]]
[[if isRefundExchange=="1"]]
<a class="btn btn-danger btn-sm close-category " style="width:50px" href="javascript:;"></a>
[[/if]]
[[if isRefundExchange=="0"]]
<a class="btn btn-warning btn-sm open-category " style="width:50px" href="javascript:;"></a>
[[/if]]
</span>
</script>
... ...
... ... @@ -42,10 +42,8 @@ var Bll = {
}
};
/**
* 获取数据
* 列表
*/
var g = new common.grid({
el: "#basicTable",
columns: [
... ... @@ -65,22 +63,13 @@ var g = new common.grid({
function init(item) {
if (top) {
html += "<div id='category_id_" + item.id + "' class='level-wrap clearfix'>";
if (item.isRefundExchange == 0) {
isRefundExchange = 0;
}
top = false;
} else {
html += "<div id='category_id_" + item.id + "' class='level-wrap clearfix level_" + item.sortLevel + "' style='display: none'>";
if (item.isRefundExchange == 0) {
isRefundExchange = 0;
}
}
html += common.util.__template2($('#tableTemp2').html(), item);
if (item.subList) {
if (item.subList.length>0) {//如果有子集
for (var i = 0; i < item.subList.length; i++) {
if (isRefundExchange == 0) {
item.subList[i].isok = true;
}
init(item.subList[i]);
}
}
... ... @@ -97,6 +86,11 @@ g.init(Bll.dataList);
$(document).on('click', '.folder', function () {
var $wrap = $(this).parent();
if (!$(this).hasClass('open')) {
var isfont = $(this).data('name');
if(isfont==0){
$wrap.find('.level-wrap .operate a').hide();
}
if ($wrap.find('> .level-wrap').size() > 0) {
var position = $(this).css("background-position");
var a = position.substring(0, position.indexOf("px"));
... ...