Authored by 陶雨

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

@@ -162,6 +162,15 @@ var Bll = { @@ -162,6 +162,15 @@ var Bll = {
162 }, 162 },
163 __render: function (selecter, templater, data) { 163 __render: function (selecter, templater, data) {
164 $(selecter).html(common.util.__template2($("#" + templater).html(), data)); 164 $(selecter).html(common.util.__template2($("#" + templater).html(), data));
  165 + if(selecter == "#add-content") {
  166 + $(selecter).sortable({
  167 + items:".dragItem",
  168 + array:Bll.contentDatas,
  169 + callback:function(data){
  170 + Bll.contentDatas = data;
  171 + }
  172 + });
  173 + }
165 }, 174 },
166 Tags: [] 175 Tags: []
167 }; 176 };
@@ -358,18 +367,18 @@ $(document).on("dblclick", "#add-content>li.custom-group", function () { @@ -358,18 +367,18 @@ $(document).on("dblclick", "#add-content>li.custom-group", function () {
358 $(this).find(".edit").click(); 367 $(this).find(".edit").click();
359 }); 368 });
360 //拖拽 369 //拖拽
361 -$(document).on("mouseover", ".dragItem1", function () {  
362 - var drag = new common.drag("#add-content", Bll.contentDatas, function (data) {  
363 - Bll.contentDatas = data;  
364 - Bll.__render("#add-content", "template_content", {modules: Bll.contentDatas});  
365 - });  
366 - drag.Initialize();  
367 -});  
368 -$(document).on("mouseleave", ".dragItem1", function () {  
369 - document.onmousemove = null;  
370 - document.onmouseup = null;  
371 - new common.drag("#add-content").destroy();  
372 -}); 370 +//$(document).on("mouseover", ".dragItem1", function () {
  371 +// var drag = new common.drag("#add-content", Bll.contentDatas, function (data) {
  372 +// Bll.contentDatas = data;
  373 +// Bll.__render("#add-content", "template_content", {modules: Bll.contentDatas});
  374 +// });
  375 +// drag.Initialize();
  376 +//});
  377 +//$(document).on("mouseleave", ".dragItem1", function () {
  378 +// document.onmousemove = null;
  379 +// document.onmouseup = null;
  380 +// new common.drag("#add-content").destroy();
  381 +//});
373 382
374 383
375 /******************************************标签部分**********************************/ 384 /******************************************标签部分**********************************/
@@ -34,6 +34,15 @@ var Bll = { @@ -34,6 +34,15 @@ var Bll = {
34 module: null, 34 module: null,
35 __render: function (selecter, templater, data) { 35 __render: function (selecter, templater, data) {
36 $(selecter).html(common.util.__template2($("#" + templater).html(), data)); 36 $(selecter).html(common.util.__template2($("#" + templater).html(), data));
  37 + if(selecter == "#add-content") {
  38 + $(selecter).sortable({
  39 + items: ".dragItem",
  40 + array: Bll.contentDatas[currIndex],
  41 + callback: function (data) {
  42 + Bll.contentDatas[currIndex] = data;
  43 + }
  44 + });
  45 + }
37 }, 46 },
38 toast: function (index, module) { 47 toast: function (index, module) {
39 var btn = Button.filter(function (item) { 48 var btn = Button.filter(function (item) {
@@ -292,13 +301,6 @@ for(var i = 0; i < resources.length; i++) { @@ -292,13 +301,6 @@ for(var i = 0; i < resources.length; i++) {
292 301
293 /*第三部解析楼层*/ 302 /*第三部解析楼层*/
294 Bll.__render("#add-content", "template_content", {modules: Bll.contentDatas[currIndex]}); 303 Bll.__render("#add-content", "template_content", {modules: Bll.contentDatas[currIndex]});
295 -$("#add-content").sortable({  
296 - items:".dragItem",  
297 - array:Bll.contentDatas[currIndex],  
298 - callback:function(data){  
299 - Bll.contentDatas[currIndex] = data;  
300 - }  
301 -});  
302 304
303 /*第四部 操作按钮 添加 删除 修改*/ 305 /*第四部 操作按钮 添加 删除 修改*/
304 $(document).on("click", ".add_btn", function () { 306 $(document).on("click", ".add_btn", function () {