Authored by 陶雨

资源内容和资讯管理楼层拖拽问题

... ... @@ -162,6 +162,15 @@ var Bll = {
},
__render: function (selecter, templater, data) {
$(selecter).html(common.util.__template2($("#" + templater).html(), data));
if(selecter == "#add-content") {
$(selecter).sortable({
items:".dragItem",
array:Bll.contentDatas,
callback:function(data){
Bll.contentDatas = data;
}
});
}
},
Tags: []
};
... ... @@ -358,18 +367,18 @@ $(document).on("dblclick", "#add-content>li.custom-group", function () {
$(this).find(".edit").click();
});
//拖拽
$(document).on("mouseover", ".dragItem1", function () {
var drag = new common.drag("#add-content", Bll.contentDatas, function (data) {
Bll.contentDatas = data;
Bll.__render("#add-content", "template_content", {modules: Bll.contentDatas});
});
drag.Initialize();
});
$(document).on("mouseleave", ".dragItem1", function () {
document.onmousemove = null;
document.onmouseup = null;
new common.drag("#add-content").destroy();
});
//$(document).on("mouseover", ".dragItem1", function () {
// var drag = new common.drag("#add-content", Bll.contentDatas, function (data) {
// Bll.contentDatas = data;
// Bll.__render("#add-content", "template_content", {modules: Bll.contentDatas});
// });
// drag.Initialize();
//});
//$(document).on("mouseleave", ".dragItem1", function () {
// document.onmousemove = null;
// document.onmouseup = null;
// new common.drag("#add-content").destroy();
//});
/******************************************标签部分**********************************/
... ...
... ... @@ -34,6 +34,15 @@ var Bll = {
module: null,
__render: function (selecter, templater, data) {
$(selecter).html(common.util.__template2($("#" + templater).html(), data));
if(selecter == "#add-content") {
$(selecter).sortable({
items: ".dragItem",
array: Bll.contentDatas[currIndex],
callback: function (data) {
Bll.contentDatas[currIndex] = data;
}
});
}
},
toast: function (index, module) {
var btn = Button.filter(function (item) {
... ... @@ -292,13 +301,6 @@ for(var i = 0; i < resources.length; i++) {
/*第三部解析楼层*/
Bll.__render("#add-content", "template_content", {modules: Bll.contentDatas[currIndex]});
$("#add-content").sortable({
items:".dragItem",
array:Bll.contentDatas[currIndex],
callback:function(data){
Bll.contentDatas[currIndex] = data;
}
});
/*第四部 操作按钮 添加 删除 修改*/
$(document).on("click", ".add_btn", function () {
... ...