SubSource.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. MWF.xApplication.portal.PageDesigner.Module.SubSource = MWF.PCSubSource = new Class({
  2. Extends: MWF.FCDiv,
  3. Implements: [Options, Events],
  4. options: {
  5. "style": "default",
  6. "propertyPath": "../x_component_portal_PageDesigner/Module/SubSource/subSource.html"
  7. },
  8. initialize: function(form, options){
  9. this.setOptions(options);
  10. this.path = "../x_component_portal_PageDesigner/Module/SubSource/";
  11. this.cssPath = "../x_component_portal_PageDesigner/Module/SubSource/"+this.options.style+"/css.wcss";
  12. this._loadCss();
  13. this.moduleType = "container";
  14. this.moduleName = "SubSource";
  15. this.Node = null;
  16. this.form = form;
  17. },
  18. _createMoveNode: function(){
  19. this.moveNode = new Element("div", {
  20. "MWFType": "subSource",
  21. "id": this.json.id,
  22. "styles": this.css.moduleNodeMove,
  23. "events": {
  24. "selectstart": function(){
  25. return false;
  26. }
  27. }
  28. }).inject(this.form.container);
  29. },
  30. _onMoveEnter: function(dragging, inObj){
  31. var module = inObj.retrieve("module");
  32. var pmodule = module;
  33. var flag = false;
  34. while (pmodule){
  35. if (pmodule.moduleName == "Source"){
  36. flag = true;
  37. break;
  38. }
  39. pmodule = pmodule.parentContainer;
  40. }
  41. if (flag){
  42. if (module) module._dragIn(this);
  43. this._onEnterOther(dragging, inObj);
  44. }
  45. },
  46. _nodeDrag: function(){}
  47. });