$Module.js 21 KB

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