$Module.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779
  1. MWF.xApplication.process.FormDesigner.Module = MWF.xApplication.process.FormDesigner.Module || {};
  2. MWF.require("MWF.widget.Common", null, false);
  3. MWF.xDesktop.requireApp("process.FormDesigner", "Property", null, false);
  4. MWF.xApplication.process.FormDesigner.Module.$Module = MWF.FC$Module = new Class({
  5. Extends: MWF.widget.Common,
  6. Implements: [Options, Events],
  7. options: {
  8. "style": "default",
  9. "actions": [
  10. {
  11. "name": "move",
  12. "icon": "move1.png",
  13. "event": "mousedown",
  14. "action": "move",
  15. "title": MWF.APPFD.LP.formAction.move
  16. },
  17. {
  18. "name": "copy",
  19. "icon": "copy1.png",
  20. "event": "mousedown",
  21. "action": "copy",
  22. "title": MWF.APPFD.LP.formAction.copy
  23. },
  24. {
  25. "name": "delete",
  26. "icon": "delete1.png",
  27. "event": "click",
  28. "action": "delete",
  29. "title": MWF.APPFD.LP.formAction["delete"]
  30. }
  31. ],
  32. "actionNodeStyles": {
  33. "width": "16px",
  34. "height": "16px",
  35. "margin-left": "2px",
  36. "margin-right": "2px",
  37. "float": "left",
  38. "border": "1px solid #F1F1F1",
  39. "cursor": "pointer"
  40. },
  41. "propertyPath": "/x_component_process_FormDesigner/Module/Label/label.html"
  42. },
  43. _getNewId: function(prefix, moduleName){
  44. var p = "";
  45. if (prefix){
  46. p = prefix+"_";
  47. }
  48. if (!moduleName) moduleName = this.moduleName;
  49. var idx = 1;
  50. var id = p+moduleName;
  51. while (this.form.json.moduleList[id]){
  52. id = p+moduleName+"_"+idx;
  53. idx++;
  54. }
  55. return id;
  56. },
  57. load : function(json, node, parent){
  58. this.json = json;
  59. this.node= node;
  60. this.node.store("module", this);
  61. this.node.setStyles(this.css.moduleNode);
  62. this._loadNodeStyles();
  63. this._loadTreeNode(parent);
  64. this._initModule();
  65. this.parentContainer = this.treeNode.parentNode.module;
  66. this._setEditStyle_custom("id");
  67. this.json.moduleName = this.moduleName;
  68. },
  69. _loadNodeStyles: function(){
  70. },
  71. _loadNodeCustomStyles: function(){
  72. this.setCustomStyles();
  73. },
  74. _loadTreeNode: function(parent){
  75. var title = this.json.name || this.json.id;
  76. var text = this.json.type.substr(this.json.type.lastIndexOf("$")+1, this.json.type.length);
  77. var o = {
  78. "expand": true,
  79. "title": this.json.id,
  80. "text": "<"+text+"> "+title,
  81. "icon": ""
  82. };
  83. o.action = function(){
  84. if (this.module) this.module.selected();
  85. };
  86. if (this.nextModule){
  87. this.treeNode = this.nextModule.treeNode.insertChild(o);
  88. }else{
  89. this.treeNode = parent.treeNode.appendChild(o);
  90. }
  91. this.treeNode.module = this;
  92. },
  93. copyStyles: function(from, to){
  94. if (!this.json[to]) this.json[to] = {};
  95. Object.each(from, function(style, key){
  96. //if (!this.json[to][key])
  97. this.json[to][key] = style;
  98. }.bind(this));
  99. },
  100. removeStyles: function(from, to){
  101. if (this.json[to]){
  102. Object.each(from, function(style, key){
  103. if (this.json[to][key] && this.json[to][key]==style){
  104. delete this.json[to][key];
  105. }
  106. }.bind(this));
  107. }
  108. },
  109. setTemplateStyles: function(styles){
  110. if (styles.styles) this.copyStyles(styles.styles, "styles");
  111. if (styles.properties) this.copyStyles(styles.properties, "properties");
  112. },
  113. clearTemplateStyles: function(styles){
  114. if (styles){
  115. if (styles.styles) this.removeStyles(styles.styles, "styles");
  116. if (styles.properties) this.removeStyles(styles.properties, "properties");
  117. }
  118. },
  119. setStyleTemplate: function(){
  120. if (this.form.stylesList){
  121. if (this.form.json.formStyleType){
  122. if (this.form.stylesList[this.form.json.formStyleType]){
  123. if (this.form.stylesList[this.form.json.formStyleType][this.moduleName]){
  124. this.setTemplateStyles(this.form.stylesList[this.form.json.formStyleType][this.moduleName]);
  125. }
  126. }
  127. }
  128. }
  129. },
  130. setAllStyles: function(){
  131. this.setPropertiesOrStyles("styles");
  132. this.setPropertiesOrStyles("properties");
  133. this.reloadMaplist();
  134. },
  135. _initModule: function(){
  136. this.setStyleTemplate();
  137. this.setPropertiesOrStyles("styles");
  138. this.setPropertiesOrStyles("properties");
  139. this._setNodeProperty();
  140. this._createIconAction();
  141. this._setNodeEvent();
  142. },
  143. _setNodeProperty: function(){},
  144. _createIconAction: function(){
  145. if (!this.actionArea){
  146. this.actionArea = new Element("div", {
  147. styles: {
  148. "display": "none",
  149. // "width": 18*this.options.actions.length,
  150. "position": "absolute",
  151. "background-color": "#F1F1F1",
  152. "padding": "1px",
  153. "padding-right": "0px",
  154. "border": "1px solid #AAA",
  155. "box-shadow": "0px 2px 5px #999",
  156. "opacity": 1,
  157. "z-index": 100
  158. }
  159. }).inject(this.form.container, "after");
  160. this.options.actions.each(function(action){
  161. var actionNode = new Element("div", {
  162. "styles": this.options.actionNodeStyles,
  163. "title": action.title
  164. }).inject(this.actionArea);
  165. actionNode.setStyle("background", "url("+this.path+this.options.style+"/icon/"+action.icon+") no-repeat left center");
  166. actionNode.addEvent(action.event, function(e){
  167. this[action.action](e);
  168. }.bind(this));
  169. actionNode.addEvents({
  170. "mouseover": function(e){
  171. e.target.setStyle("border", "1px solid #999");
  172. }.bind(this),
  173. "mouseout": function(e){
  174. e.target.setStyle("border", "1px solid #F1F1F1");
  175. }.bind(this)
  176. });
  177. }.bind(this));
  178. this._createCustomIconAction();
  179. }
  180. },
  181. _createCustomIconAction: function(){},
  182. _setActionAreaPosition: function(){
  183. var p = this.node.getPosition(this.form.node.getOffsetParent());
  184. var y = p.y-25;
  185. var x = p.x;
  186. this.actionArea.setPosition({"x": x, "y": y});
  187. },
  188. _moveTo: function(container){
  189. this.parentContainer = container;
  190. if (!this.node){
  191. this._createNode();
  192. }
  193. this._resetTreeNode();
  194. this.node.inject(container.node);
  195. },
  196. move: function(e){
  197. this._createMoveNode();
  198. var thisDisplay = this.node.getStyle("display");
  199. this.node.store("thisDisplay", thisDisplay);
  200. this.node.setStyle("display", "none");
  201. this._setNodeMove(e);
  202. },
  203. copy: function(e){
  204. this.copyTo().move(e);
  205. },
  206. copyTo: function(node){
  207. if (!node) node = this.form;
  208. var newNode = this.node.clone(true, true);
  209. var newModuleJson = Object.clone(this.json);
  210. newNode.inject(node.node);
  211. var className = this.moduleName.capitalize();
  212. var newTool = new MWF["FC"+className](this.form);
  213. newModuleJson.id = newTool._getNewId();
  214. newNode.set("id", newModuleJson.id);
  215. this.form.json.moduleList[newModuleJson.id] = newModuleJson;
  216. newTool.load(newModuleJson, newNode, node);
  217. return newTool;
  218. },
  219. "delete": function(e){
  220. var module = this;
  221. this.form.designer.shortcut = false;
  222. this.form.designer.confirm("warn", module.node, MWF.APPFD.LP.notice.deleteElementTitle, MWF.APPFD.LP.notice.deleteElement, 300, 120, function(){
  223. module.destroy();
  224. module.form.selected();
  225. module.form.designer.shortcut = true;
  226. this.close();
  227. }, function(){
  228. module.form.designer.shortcut = true;
  229. this.close();
  230. }, null);
  231. },
  232. _setNodeEvent: function(){
  233. if (!this.isSetEvents){
  234. this.node.addEvent("click", function(e){
  235. if (!this.form.noSelected) this.selected();
  236. this.form.noSelected = false;
  237. e.stopPropagation();
  238. }.bind(this));
  239. this.node.addEvent("mouseover", function(e){
  240. this.over();
  241. e.stopPropagation();
  242. }.bind(this));
  243. this.node.addEvent("mouseout", function(e){
  244. this.unOver();
  245. e.stopPropagation();
  246. }.bind(this));
  247. this.node.addEvent("copy", function(e){
  248. this.copyModule(e);
  249. });
  250. this._setOtherNodeEvent();
  251. this.isSetEvents = true;
  252. }
  253. },
  254. copyModule: function(e){
  255. debugger;
  256. },
  257. _setOtherNodeEvent: function(){},
  258. over: function(){
  259. if (!this.form.moveModule) if (this.form.currentSelectedModule!=this){
  260. this.node.store("normalBorder", this.node.getBorder());
  261. this.node.setStyles({
  262. "border-width": "1px",
  263. "border-color": "#4e73ff"
  264. });
  265. }
  266. },
  267. unOver: function(){
  268. if (!this.form.moveModule) if (this.form.currentSelectedModule!=this){
  269. this.node.setStyles({
  270. "border-width": "1px",
  271. "border-color": "#333"
  272. });
  273. var border = this.node.retrieve("normalBorder");
  274. this.node.setStyles(border);
  275. }
  276. },
  277. _showActions: function(){
  278. if (this.actionArea){
  279. if (this.options.actions.length){
  280. this._setActionAreaPosition();
  281. this.actionArea.setStyle("display", "block");
  282. }
  283. }
  284. },
  285. _hideActions: function(){
  286. if (this.actionArea) this.actionArea.setStyle("display", "none");
  287. },
  288. selected: function(){
  289. debugger;
  290. if (this.form.currentSelectedModule){
  291. if (this.form.currentSelectedModule==this){
  292. return true;
  293. }else{
  294. this.form.currentSelectedModule.unSelected();
  295. }
  296. }
  297. if (this.form.propertyMultiTd){
  298. this.form.propertyMultiTd.hide();
  299. this.form.propertyMultiTd = null;
  300. }
  301. this.form.unSelectedMulti();
  302. this.node.setStyles({
  303. "border-width": "1px",
  304. "border-color": "red"
  305. });
  306. this._showActions();
  307. this.form.currentSelectedModule = this;
  308. if (this.treeNode){
  309. this.treeNode.selectNode();
  310. (new Fx.Scroll(this.form.designer.propertyDomScrollArea)).toElement(this.treeNode.node);
  311. // this.treeNode.node.scrollIntoView();
  312. }
  313. this.showProperty();
  314. },
  315. unSelected: function(){
  316. this.node.setStyles({
  317. "border-width": "1px",
  318. "border-color": "#333"
  319. });
  320. var border = this.node.retrieve("normalBorder");
  321. this.node.setStyles(border);
  322. this._hideActions();
  323. this.form.currentSelectedModule = null;
  324. this.hideProperty();
  325. },
  326. selectedMulti: function(){
  327. if (this.form.selectedModules.indexOf(this)==-1){
  328. this.form.selectedModules.push(this);
  329. this.node.setStyle("border-color", "red");
  330. }
  331. },
  332. unSelectedMulti: function(){
  333. if (this.form.selectedModules.indexOf(this)!=-1){
  334. this.form.selectedModules.erase(this);
  335. this.node.setStyle("border-color", "#333");
  336. }
  337. },
  338. showProperty: function(){
  339. if (!this.property){
  340. this.property = new MWF.xApplication.process.FormDesigner.Property(this, this.form.designer.propertyContentArea, this.form.designer, {
  341. "path": this.options.propertyPath,
  342. "onPostLoad": function(){
  343. this.property.show();
  344. }.bind(this)
  345. });
  346. this.property.load();
  347. }else{
  348. this.property.show();
  349. }
  350. },
  351. hideProperty: function(){
  352. if (this.property) this.property.hide();
  353. },
  354. create: function(data, e){
  355. this.json = data;
  356. this.json.id = this._getNewId();
  357. this._createMoveNode();
  358. this._setNodeMove(e);
  359. },
  360. _createMoveNode: function(){
  361. this.moveNode = new Element("div", {
  362. "MWFType": "label",
  363. "styles": this.css.moduleNodeMove,
  364. "text": "Text",
  365. "events": {
  366. "selectstart": function(){
  367. return false;
  368. }
  369. }
  370. }).inject(this.form.container);
  371. },
  372. _onEnterOther: function(dragging, inObj){
  373. },
  374. _onLeaveOther: function(dragging, inObj){
  375. },
  376. _setNodeMove: function(e){
  377. this._setMoveNodePosition(e);
  378. var droppables = [this.form.node].concat(this.form.moduleElementNodeList, this.form.moduleContainerNodeList, this.form.moduleComponentNodeList);
  379. var nodeDrag = new Drag.Move(this.moveNode, {
  380. "droppables": droppables,
  381. "onEnter": function(dragging, inObj){
  382. var module = inObj.retrieve("module");
  383. if (module) module._dragIn(this);
  384. this._onEnterOther(dragging, inObj);
  385. }.bind(this),
  386. "onLeave": function(dragging, inObj){
  387. var module = inObj.retrieve("module");
  388. if (module) module._dragOut(this);
  389. this._onLeaveOther(dragging, inObj);
  390. }.bind(this),
  391. "onDrag": function(e){
  392. this._nodeDrag(e, nodeDrag);
  393. }.bind(this),
  394. "onDrop": function(dragging, inObj){
  395. if (inObj){
  396. var module = inObj.retrieve("module");
  397. if (module) module._dragDrop(this);
  398. this._nodeDrop();
  399. }else{
  400. this._dragCancel(dragging);
  401. }
  402. }.bind(this),
  403. "onCancel": function(dragging){
  404. this._dragCancel(dragging);
  405. }.bind(this)
  406. });
  407. nodeDrag.start(e);
  408. this.form.moveModule = this;
  409. this.form.recordCurrentSelectedModule = this.form.currentSelectedModule;
  410. // var d = (new Date()).getTime();
  411. this.form.selected();
  412. //var d1 = (new Date()).getTime();
  413. //alert((d1-d))
  414. },
  415. _setMoveNodePosition: function(e){
  416. // var x = e.event.clientX+2;
  417. // var y = e.event.clientY+2;
  418. var x = e.page.x+2;
  419. var y = e.page.y+2;
  420. this.moveNode.positionTo(x, y);
  421. // this.moveNode.setStyles({
  422. // "top": y,
  423. // "left": x
  424. // });
  425. },
  426. _getCopyNode: function(){
  427. if (!this.copyNode) this._createCopyNode();
  428. this.copyNode.setStyles(this.css.moduleNodeShow);
  429. // this.copyNode.setStyle("display", "block");
  430. return this.copyNode;
  431. },
  432. _createCopyNode: function(){
  433. this.copyNode = this.moveNode.clone();
  434. this.copyNode.setStyles(this.css.moduleNodeShow);
  435. this.copyNode.addEvent("selectstart", function(){
  436. return false;
  437. });
  438. },
  439. _nodeDrop: function(){
  440. if (this.parentContainer){
  441. this._dragComplete();
  442. }else{
  443. this._dragCancel();
  444. }
  445. },
  446. _dragComplete: function(){
  447. if (!this.node){
  448. this._createNode();
  449. }
  450. this._resetTreeNode();
  451. this.node.inject(this.copyNode, "before");
  452. this._initModule();
  453. var thisDisplay = this.node.retrieve("thisDisplay");
  454. if (thisDisplay){
  455. this.node.setStyle("display", thisDisplay);
  456. }
  457. if (this.copyNode) this.copyNode.destroy();
  458. if (this.moveNode) this.moveNode.destroy();
  459. this.moveNode = null;
  460. this.copyNode = null;
  461. this.nextModule = null;
  462. this.form.moveModule = null;
  463. this.form.json.moduleList[this.json.id] = this.json;
  464. this.selected();
  465. },
  466. _resetTreeNode: function(){
  467. if (this.parentContainer){
  468. if (this.treeNode){
  469. if (this.treeNode.parentNode){
  470. var originalModule = this.treeNode.parentNode.module;
  471. // if (originalModule == this.parentContainer){
  472. // if (!this.nextModule) return true;
  473. // };
  474. }
  475. this.treeNode.destroy();
  476. }
  477. this._loadTreeNode(this.parentContainer);
  478. if (this.treeNode.parentNode){
  479. if (!this.treeNode.parentNode.options.expand) this.treeNode.parentNode.expandOrCollapse();
  480. }
  481. this._resetSubTreeNode(this.node)
  482. }
  483. },
  484. _resetSubTreeNode: function(node){
  485. var subNode = node.getFirst();
  486. while (subNode){
  487. var module = subNode.retrieve("module");
  488. if (module) module._resetTreeNode();
  489. this._resetSubTreeNode(subNode);
  490. subNode = subNode.getNext();
  491. }
  492. },
  493. _createNode: function(){
  494. this.node = this.moveNode.clone(true, true);
  495. this.node.setStyles(this.css.moduleNode);
  496. this.node.set("id", this.json.id);
  497. this.node.addEvent("selectstart", function(){
  498. return false;
  499. });
  500. },
  501. _dragCancel: function(){
  502. if (this.node){
  503. var thisDisplay = this.node.retrieve("thisDisplay");
  504. if (thisDisplay){
  505. this.node.setStyle("display", thisDisplay);
  506. }
  507. this.selected();
  508. }else{
  509. this.data = null;
  510. if (this.form.recordCurrentSelectedModule) this.form.recordCurrentSelectedModule.selected();
  511. }
  512. if (this.moveNode) this.moveNode.destroy();
  513. if (this.copyNode) this.copyNode.destroy();
  514. this.copyNode = null;
  515. this.moveNode = null;
  516. this.form.moveModule = null;
  517. },
  518. _nodeDrag: function(e, drag){
  519. if (this.inContainer){
  520. var p = this.inContainer.node.getCoordinates();
  521. var now = drag.mouse.now;
  522. var height = p.height*0.4;
  523. var y = p.top.toFloat()+height.toFloat();
  524. if (this.inContainer == this.parentContainer){
  525. if (this.parentContainer!=this.form){
  526. if (now.x > p.left && now.x < p.right && now.y < y && now.y > p.top){
  527. this.parentContainer.node.setStyles(this.parentContainer.css.moduleNode);
  528. this.parentContainer.node.setStyles(this.parentContainer.json.styles);
  529. this.parentContainer._dragInLikeElement(this);
  530. }
  531. }
  532. }else{
  533. if (now.x > p.left && now.x < p.right && now.y < p.bottom && now.y > y){
  534. this.parentContainer.node.setStyles(this.parentContainer.css.moduleNode);
  535. this.parentContainer.node.setStyles(this.parentContainer.json.styles);
  536. this.inContainer._dragIn(this);
  537. }
  538. }
  539. }
  540. },
  541. setPropertiesOrStyles: function(name){
  542. if (name=="styles"){
  543. this.setCustomStyles();
  544. }
  545. if (name=="properties"){
  546. this.node.setProperties(this.json.properties);
  547. }
  548. },
  549. setCustomNodeStyles: function(node, styles){
  550. var border = node.getStyle("border");
  551. node.clearStyles();
  552. //node.setStyles(styles);
  553. node.setStyle("border", border);
  554. Object.each(styles, function(value, key){
  555. var reg = /^border\w*/ig;
  556. if (!key.test(reg)){
  557. node.setStyle(key, value);
  558. }
  559. }.bind(this));
  560. },
  561. setCustomStyles: function(){
  562. var border = this.node.getStyle("border");
  563. this.node.clearStyles();
  564. this.node.setStyles(this.css.moduleNode);
  565. if (this.initialStyles) this.node.setStyles(this.initialStyles);
  566. this.node.setStyle("border", border);
  567. Object.each(this.json.styles, function(value, key){
  568. var reg = /^border\w*/ig;
  569. if (!key.test(reg)){
  570. if (key) this.node.setStyle(key, value);
  571. }
  572. }.bind(this));
  573. },
  574. _setEditStyle: function(name, obj, oldValue){
  575. if (name=="name"){
  576. var title = this.json.name || this.json.id;
  577. var text = this.json.type.substr(this.json.type.lastIndexOf("$")+1, this.json.type.length);
  578. this.treeNode.setText("<"+text+"> "+title);
  579. }
  580. if (name=="id"){
  581. if (!this.json.name){
  582. var text = this.json.type.substr(this.json.type.lastIndexOf("$")+1, this.json.type.length);
  583. this.treeNode.setText("<"+text+"> "+this.json.id);
  584. }
  585. this.treeNode.setTitle(this.json.id);
  586. this.node.set("id", this.json.id);
  587. }
  588. this._setEditStyle_custom(name, obj, oldValue);
  589. },
  590. reloadMaplist: function(){
  591. if (this.property) Object.each(this.property.maplists, function(map, name){ map.reload(this.json[name]);}.bind(this));
  592. },
  593. _setEditStyle_custom: function(name, obj, oldValue){
  594. },
  595. getHtml: function(){
  596. var copy = this.node.clone(true, true);
  597. copy.clearStyles(true);
  598. this.form._clearNoId(copy);
  599. var html = copy.outerHTML;
  600. copy.destroy();
  601. return html;
  602. },
  603. _getSubModuleJson: function(node, moduleJsons){
  604. var subNode = node.getFirst();
  605. while (subNode){
  606. var module = subNode.retrieve("module");
  607. if (module) {
  608. moduleJsons[module.json.id] = Object.clone(module.json);
  609. }
  610. this._getSubModuleJson(subNode, moduleJsons);
  611. subNode = subNode.getNext();
  612. }
  613. },
  614. getJson: function(){
  615. var json = Object.clone(this.json);
  616. var o = {};
  617. o[json.id] = json;
  618. this._getSubModuleJson(this.node, o);
  619. return o;
  620. }
  621. // dragInElement: function(dragging, inObj, module){
  622. // this.containerNode = module.containerNode;
  623. //
  624. // // var border = this.containerNode.retrieve("thisborder", null);
  625. // // if (!border){
  626. // var top = this.containerNode.getStyle("border-top");
  627. // var left = this.containerNode.getStyle("border-left");
  628. // var bottom = this.containerNode.getStyle("border-bottom");
  629. // var right = this.containerNode.getStyle("border-right");
  630. //
  631. // this.containerNode.store("thisborder", {"top": top, "left": left, "bottom": bottom, "right": right});
  632. // // }
  633. // this.containerNode.setStyles({"border": "1px solid #ffa200"});
  634. //
  635. // if (!this.copyNode) this.createCopyNode(dragging, inObj);
  636. // this.copyNode.inject(inObj, "before");
  637. // },
  638. // dragInContainer: function(dragging, inObj){
  639. // // var border = inObj.retrieve("thisborder", null);
  640. // // if (!border){
  641. // var top = inObj.getStyle("border-top");
  642. // var left = inObj.getStyle("border-left");
  643. // var bottom = inObj.getStyle("border-bottom");
  644. // var right = inObj.getStyle("border-right");
  645. // inObj.store("thisborder", {"top": top, "left": left, "bottom": bottom, "right": right});
  646. // // }
  647. //
  648. // inObj.setStyles({"border": "1px solid #ffa200"});
  649. //
  650. // if (!this.copyNode) this.createCopyNode(dragging, inObj);
  651. //
  652. // this.copyNode.inject(inObj);
  653. //
  654. // this.containerNode = inObj;
  655. // },
  656. //
  657. //
  658. // dragOutElement: function(dragging, inObj){
  659. // var border = this.containerNode.retrieve("thisborder");
  660. // if (border) {
  661. // this.containerNode.setStyles({
  662. // "border-top": border.top,
  663. // "border-left": border.left,
  664. // "border-bottom": border.bottom,
  665. // "border-right": border.right
  666. // });
  667. // }
  668. // this.containerNode = null;
  669. // },
  670. // dragOutContainer: function(dragging, inObj){
  671. // var border = inObj.retrieve("thisborder");
  672. // if (border) {
  673. // inObj.setStyles({
  674. // "border-top": border.top,
  675. // "border-left": border.left,
  676. // "border-bottom": border.bottom,
  677. // "border-right": border.right
  678. // });
  679. // // inObj.setStyles({"border": border});
  680. // }
  681. // if (!this.node){
  682. // if (this.copyNode){
  683. // this.copyNode.destroy();
  684. // this.copyNode = null;
  685. // }
  686. // }
  687. // this.containerNode = null;
  688. // },
  689. //
  690. //
  691. //
  692. //
  693. // dragCancel: function(dragging){
  694. // if (this.node){
  695. // var thisDisplay = this.node.retrieve("thisDisplay");
  696. // if (thisDisplay){
  697. // this.node.setStyle("display", thisDisplay);
  698. // }
  699. // this.selected();
  700. // }else{
  701. // this.data = null;
  702. // if (this.form.recordCurrentSelectedModule) this.form.recordCurrentSelectedModule.selected();
  703. // }
  704. // if (dragging) dragging.destroy();
  705. // if (this.copyNode) this.copyNode.destroy();
  706. // this.copyNode = null;
  707. // this.moveNode = null;
  708. // this.form.moveModule = null;
  709. // }
  710. });