$Module.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785
  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 prefix = (this.form.moduleType=="page") ? "PC" : "FC";
  216. var newTool = new MWF[prefix+className](this.form);
  217. newModuleJson.id = newTool._getNewId();
  218. newNode.set("id", newModuleJson.id);
  219. this.form.json.moduleList[newModuleJson.id] = newModuleJson;
  220. newTool.load(newModuleJson, newNode, node);
  221. return newTool;
  222. },
  223. "delete": function(e){
  224. var module = this;
  225. this.form.designer.shortcut = false;
  226. this.form.designer.confirm("warn", module.node, MWF.APPFD.LP.notice.deleteElementTitle, MWF.APPFD.LP.notice.deleteElement, 300, 120, function(){
  227. module.destroy();
  228. module.form.selected();
  229. module.form.designer.shortcut = true;
  230. this.close();
  231. }, function(){
  232. module.form.designer.shortcut = true;
  233. this.close();
  234. }, null);
  235. },
  236. _setNodeEvent: function(){
  237. if (!this.isSetEvents){
  238. this.node.addEvent("click", function(e){
  239. if (!this.form.noSelected) this.selected();
  240. this.form.noSelected = false;
  241. e.stopPropagation();
  242. }.bind(this));
  243. this.node.addEvent("mouseover", function(e){
  244. this.over();
  245. e.stopPropagation();
  246. }.bind(this));
  247. this.node.addEvent("mouseout", function(e){
  248. this.unOver();
  249. e.stopPropagation();
  250. }.bind(this));
  251. this.node.addEvent("copy", function(e){
  252. this.copyModule(e);
  253. });
  254. this._setOtherNodeEvent();
  255. this.isSetEvents = true;
  256. }
  257. },
  258. copyModule: function(e){
  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. if (this.form.currentSelectedModule){
  293. if (this.form.currentSelectedModule==this){
  294. return true;
  295. }else{
  296. this.form.currentSelectedModule.unSelected();
  297. }
  298. }
  299. if (this.form.propertyMultiTd){
  300. this.form.propertyMultiTd.hide();
  301. this.form.propertyMultiTd = null;
  302. }
  303. this.form.unSelectedMulti();
  304. this.node.setStyles({
  305. "border-width": "1px",
  306. "border-color": "red"
  307. });
  308. this._showActions();
  309. this.form.currentSelectedModule = this;
  310. if (this.treeNode){
  311. this.treeNode.selectNode();
  312. (new Fx.Scroll(this.form.designer.propertyDomScrollArea)).toElement(this.treeNode.node);
  313. // this.treeNode.node.scrollIntoView();
  314. }
  315. this.showProperty();
  316. },
  317. unSelected: function(){
  318. this.node.setStyles({
  319. "border-width": "1px",
  320. "border-color": "#333"
  321. });
  322. var border = this.node.retrieve("normalBorder");
  323. this.node.setStyles(border);
  324. this._hideActions();
  325. this.form.currentSelectedModule = null;
  326. this.hideProperty();
  327. },
  328. selectedMulti: function(){
  329. if (this.form.selectedModules.indexOf(this)==-1){
  330. this.form.selectedModules.push(this);
  331. this.node.setStyle("border-color", "red");
  332. }
  333. },
  334. unSelectedMulti: function(){
  335. if (this.form.selectedModules.indexOf(this)!=-1){
  336. this.form.selectedModules.erase(this);
  337. this.node.setStyle("border-color", "#333");
  338. }
  339. },
  340. showProperty: function(){
  341. if (!this.property){
  342. this.property = new MWF.xApplication.process.FormDesigner.Property(this, this.form.designer.propertyContentArea, this.form.designer, {
  343. "path": this.options.propertyPath,
  344. "onPostLoad": function(){
  345. this.property.show();
  346. }.bind(this)
  347. });
  348. this.property.load();
  349. }else{
  350. this.property.show();
  351. }
  352. },
  353. hideProperty: function(){
  354. if (this.property) this.property.hide();
  355. },
  356. create: function(data, e){
  357. this.json = data;
  358. this.json.id = this._getNewId();
  359. this._createMoveNode();
  360. this._setNodeMove(e);
  361. },
  362. _createMoveNode: function(){
  363. this.moveNode = new Element("div", {
  364. "MWFType": "label",
  365. "styles": this.css.moduleNodeMove,
  366. "text": "Text",
  367. "events": {
  368. "selectstart": function(){
  369. return false;
  370. }
  371. }
  372. }).inject(this.form.container);
  373. },
  374. _onEnterOther: function(dragging, inObj){
  375. },
  376. _onLeaveOther: function(dragging, inObj){
  377. },
  378. _onMoveEnter: function(dragging, inObj){
  379. var module = inObj.retrieve("module");
  380. if (module) module._dragIn(this);
  381. this._onEnterOther(dragging, inObj);
  382. },
  383. _setNodeMove: function(e){
  384. this._setMoveNodePosition(e);
  385. var droppables = [this.form.node].concat(this.form.moduleElementNodeList, this.form.moduleContainerNodeList, this.form.moduleComponentNodeList);
  386. var nodeDrag = new Drag.Move(this.moveNode, {
  387. "droppables": droppables,
  388. "onEnter": function(dragging, inObj){
  389. this._onMoveEnter(dragging, inObj);
  390. }.bind(this),
  391. "onLeave": function(dragging, inObj){
  392. var module = inObj.retrieve("module");
  393. if (module) module._dragOut(this);
  394. this._onLeaveOther(dragging, inObj);
  395. }.bind(this),
  396. "onDrag": function(e){
  397. this._nodeDrag(e, nodeDrag);
  398. }.bind(this),
  399. "onDrop": function(dragging, inObj){
  400. if (inObj){
  401. var module = inObj.retrieve("module");
  402. if (module) module._dragDrop(this);
  403. this._nodeDrop();
  404. }else{
  405. this._dragCancel(dragging);
  406. }
  407. }.bind(this),
  408. "onCancel": function(dragging){
  409. this._dragCancel(dragging);
  410. }.bind(this)
  411. });
  412. nodeDrag.start(e);
  413. this.form.moveModule = this;
  414. this.form.recordCurrentSelectedModule = this.form.currentSelectedModule;
  415. // var d = (new Date()).getTime();
  416. this.form.selected();
  417. //var d1 = (new Date()).getTime();
  418. //alert((d1-d))
  419. },
  420. _setMoveNodePosition: function(e){
  421. // var x = e.event.clientX+2;
  422. // var y = e.event.clientY+2;
  423. var x = e.page.x+2;
  424. var y = e.page.y+2;
  425. this.moveNode.positionTo(x, y);
  426. // this.moveNode.setStyles({
  427. // "top": y,
  428. // "left": x
  429. // });
  430. },
  431. _getCopyNode: function(){
  432. if (!this.copyNode) this._createCopyNode();
  433. this.copyNode.setStyles(this.css.moduleNodeShow);
  434. // this.copyNode.setStyle("display", "block");
  435. return this.copyNode;
  436. },
  437. _createCopyNode: function(){
  438. this.copyNode = this.moveNode.clone();
  439. this.copyNode.setStyles(this.css.moduleNodeShow);
  440. this.copyNode.addEvent("selectstart", function(){
  441. return false;
  442. });
  443. },
  444. _nodeDrop: function(){
  445. if (this.parentContainer){
  446. this._dragComplete();
  447. }else{
  448. this._dragCancel();
  449. }
  450. },
  451. _dragComplete: function(){
  452. this.setStyleTemplate();
  453. if (!this.node){
  454. this._createNode();
  455. }
  456. this._resetTreeNode();
  457. this.node.inject(this.copyNode, "before");
  458. this._initModule();
  459. var thisDisplay = this.node.retrieve("thisDisplay");
  460. if (thisDisplay){
  461. this.node.setStyle("display", thisDisplay);
  462. }
  463. if (this.copyNode) this.copyNode.destroy();
  464. if (this.moveNode) this.moveNode.destroy();
  465. this.moveNode = null;
  466. this.copyNode = null;
  467. this.nextModule = null;
  468. this.form.moveModule = null;
  469. this.form.json.moduleList[this.json.id] = this.json;
  470. this.selected();
  471. },
  472. _resetTreeNode: function(){
  473. if (this.parentContainer){
  474. if (this.treeNode){
  475. if (this.treeNode.parentNode){
  476. var originalModule = this.treeNode.parentNode.module;
  477. // if (originalModule == this.parentContainer){
  478. // if (!this.nextModule) return true;
  479. // };
  480. }
  481. this.treeNode.destroy();
  482. }
  483. this._loadTreeNode(this.parentContainer);
  484. if (this.treeNode.parentNode){
  485. if (!this.treeNode.parentNode.options.expand) this.treeNode.parentNode.expandOrCollapse();
  486. }
  487. this._resetSubTreeNode(this.node)
  488. }
  489. },
  490. _resetSubTreeNode: function(node){
  491. var subNode = node.getFirst();
  492. while (subNode){
  493. var module = subNode.retrieve("module");
  494. if (module) module._resetTreeNode();
  495. this._resetSubTreeNode(subNode);
  496. subNode = subNode.getNext();
  497. }
  498. },
  499. _createNode: function(){
  500. this.node = this.moveNode.clone(true, true);
  501. this.node.setStyles(this.css.moduleNode);
  502. this.node.set("id", this.json.id);
  503. this.node.addEvent("selectstart", function(){
  504. return false;
  505. });
  506. },
  507. _dragCancel: function(){
  508. if (this.node){
  509. var thisDisplay = this.node.retrieve("thisDisplay");
  510. if (thisDisplay){
  511. this.node.setStyle("display", thisDisplay);
  512. }
  513. this.selected();
  514. }else{
  515. this.data = null;
  516. if (this.form.recordCurrentSelectedModule) this.form.recordCurrentSelectedModule.selected();
  517. }
  518. if (this.moveNode) this.moveNode.destroy();
  519. if (this.copyNode) this.copyNode.destroy();
  520. this.copyNode = null;
  521. this.moveNode = null;
  522. this.form.moveModule = null;
  523. },
  524. _nodeDrag: function(e, drag){
  525. if (this.inContainer){
  526. var p = this.inContainer.node.getCoordinates();
  527. var now = drag.mouse.now;
  528. var height = p.height*0.4;
  529. var y = p.top.toFloat()+height.toFloat();
  530. if (this.inContainer == this.parentContainer){
  531. if (this.parentContainer!=this.form){
  532. if (now.x > p.left && now.x < p.right && now.y < y && now.y > p.top){
  533. this.parentContainer.node.setStyles(this.parentContainer.css.moduleNode);
  534. this.parentContainer.node.setStyles(this.parentContainer.json.styles);
  535. this.parentContainer._dragInLikeElement(this);
  536. }
  537. }
  538. }else{
  539. if (now.x > p.left && now.x < p.right && now.y < p.bottom && now.y > y){
  540. this.parentContainer.node.setStyles(this.parentContainer.css.moduleNode);
  541. this.parentContainer.node.setStyles(this.parentContainer.json.styles);
  542. this.inContainer._dragIn(this);
  543. }
  544. }
  545. }
  546. },
  547. setPropertiesOrStyles: function(name){
  548. if (name=="styles"){
  549. this.setCustomStyles();
  550. }
  551. if (name=="properties"){
  552. this.node.setProperties(this.json.properties);
  553. }
  554. },
  555. setCustomNodeStyles: function(node, styles){
  556. var border = node.getStyle("border");
  557. node.clearStyles();
  558. //node.setStyles(styles);
  559. node.setStyle("border", border);
  560. Object.each(styles, function(value, key){
  561. var reg = /^border\w*/ig;
  562. if (!key.test(reg)){
  563. node.setStyle(key, value);
  564. }
  565. }.bind(this));
  566. },
  567. setCustomStyles: function(){
  568. var border = this.node.getStyle("border");
  569. this.node.clearStyles();
  570. this.node.setStyles(this.css.moduleNode);
  571. if (this.initialStyles) this.node.setStyles(this.initialStyles);
  572. this.node.setStyle("border", border);
  573. Object.each(this.json.styles, function(value, key){
  574. var reg = /^border\w*/ig;
  575. if (!key.test(reg)){
  576. if (key) this.node.setStyle(key, value);
  577. }
  578. }.bind(this));
  579. },
  580. _setEditStyle: function(name, obj, oldValue){
  581. if (name=="name"){
  582. var title = this.json.name || this.json.id;
  583. var text = this.json.type.substr(this.json.type.lastIndexOf("$")+1, this.json.type.length);
  584. this.treeNode.setText("<"+text+"> "+title);
  585. }
  586. if (name=="id"){
  587. if (!this.json.name){
  588. var text = this.json.type.substr(this.json.type.lastIndexOf("$")+1, this.json.type.length);
  589. this.treeNode.setText("<"+text+"> "+this.json.id);
  590. }
  591. this.treeNode.setTitle(this.json.id);
  592. this.node.set("id", this.json.id);
  593. }
  594. this._setEditStyle_custom(name, obj, oldValue);
  595. },
  596. reloadMaplist: function(){
  597. if (this.property) Object.each(this.property.maplists, function(map, name){ map.reload(this.json[name]);}.bind(this));
  598. },
  599. _setEditStyle_custom: function(name, obj, oldValue){
  600. },
  601. getHtml: function(){
  602. var copy = this.node.clone(true, true);
  603. copy.clearStyles(true);
  604. this.form._clearNoId(copy);
  605. var html = copy.outerHTML;
  606. copy.destroy();
  607. return html;
  608. },
  609. _getSubModuleJson: function(node, moduleJsons){
  610. var subNode = node.getFirst();
  611. while (subNode){
  612. var module = subNode.retrieve("module");
  613. if (module) {
  614. moduleJsons[module.json.id] = Object.clone(module.json);
  615. }
  616. this._getSubModuleJson(subNode, moduleJsons);
  617. subNode = subNode.getNext();
  618. }
  619. },
  620. getJson: function(){
  621. var json = Object.clone(this.json);
  622. var o = {};
  623. o[json.id] = json;
  624. this._getSubModuleJson(this.node, o);
  625. return o;
  626. }
  627. // dragInElement: function(dragging, inObj, module){
  628. // this.containerNode = module.containerNode;
  629. //
  630. // // var border = this.containerNode.retrieve("thisborder", null);
  631. // // if (!border){
  632. // var top = this.containerNode.getStyle("border-top");
  633. // var left = this.containerNode.getStyle("border-left");
  634. // var bottom = this.containerNode.getStyle("border-bottom");
  635. // var right = this.containerNode.getStyle("border-right");
  636. //
  637. // this.containerNode.store("thisborder", {"top": top, "left": left, "bottom": bottom, "right": right});
  638. // // }
  639. // this.containerNode.setStyles({"border": "1px solid #ffa200"});
  640. //
  641. // if (!this.copyNode) this.createCopyNode(dragging, inObj);
  642. // this.copyNode.inject(inObj, "before");
  643. // },
  644. // dragInContainer: function(dragging, inObj){
  645. // // var border = inObj.retrieve("thisborder", null);
  646. // // if (!border){
  647. // var top = inObj.getStyle("border-top");
  648. // var left = inObj.getStyle("border-left");
  649. // var bottom = inObj.getStyle("border-bottom");
  650. // var right = inObj.getStyle("border-right");
  651. // inObj.store("thisborder", {"top": top, "left": left, "bottom": bottom, "right": right});
  652. // // }
  653. //
  654. // inObj.setStyles({"border": "1px solid #ffa200"});
  655. //
  656. // if (!this.copyNode) this.createCopyNode(dragging, inObj);
  657. //
  658. // this.copyNode.inject(inObj);
  659. //
  660. // this.containerNode = inObj;
  661. // },
  662. //
  663. //
  664. // dragOutElement: function(dragging, inObj){
  665. // var border = this.containerNode.retrieve("thisborder");
  666. // if (border) {
  667. // this.containerNode.setStyles({
  668. // "border-top": border.top,
  669. // "border-left": border.left,
  670. // "border-bottom": border.bottom,
  671. // "border-right": border.right
  672. // });
  673. // }
  674. // this.containerNode = null;
  675. // },
  676. // dragOutContainer: function(dragging, inObj){
  677. // var border = inObj.retrieve("thisborder");
  678. // if (border) {
  679. // inObj.setStyles({
  680. // "border-top": border.top,
  681. // "border-left": border.left,
  682. // "border-bottom": border.bottom,
  683. // "border-right": border.right
  684. // });
  685. // // inObj.setStyles({"border": border});
  686. // }
  687. // if (!this.node){
  688. // if (this.copyNode){
  689. // this.copyNode.destroy();
  690. // this.copyNode = null;
  691. // }
  692. // }
  693. // this.containerNode = null;
  694. // },
  695. //
  696. //
  697. //
  698. //
  699. // dragCancel: function(dragging){
  700. // if (this.node){
  701. // var thisDisplay = this.node.retrieve("thisDisplay");
  702. // if (thisDisplay){
  703. // this.node.setStyle("display", thisDisplay);
  704. // }
  705. // this.selected();
  706. // }else{
  707. // this.data = null;
  708. // if (this.form.recordCurrentSelectedModule) this.form.recordCurrentSelectedModule.selected();
  709. // }
  710. // if (dragging) dragging.destroy();
  711. // if (this.copyNode) this.copyNode.destroy();
  712. // this.copyNode = null;
  713. // this.moveNode = null;
  714. // this.form.moveModule = null;
  715. // }
  716. });