SourceText.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. MWF.xApplication.portal.PageDesigner.Module.SourceText = MWF.PCSourceText = new Class({
  2. Extends: MWF.FCLabel,
  3. Implements: [Options, Events],
  4. options: {
  5. "style": "default",
  6. "propertyPath": "../x_component_portal_PageDesigner/Module/SourceText/sourceText.html"
  7. },
  8. initialize: function(form, options){
  9. this.setOptions(options);
  10. this.path = "../x_component_portal_PageDesigner/Module/SourceText/";
  11. this.cssPath = "../x_component_portal_PageDesigner/Module/SourceText/"+this.options.style+"/css.wcss";
  12. this._loadCss();
  13. this.moduleType = "element";
  14. this.moduleName = "SourceText";
  15. this.Node = null;
  16. this.form = form;
  17. },
  18. _createMoveNode: function(){
  19. this.moveNode = new Element("div", {
  20. "MWFType": "sourceText",
  21. "styles": this.css.moduleNodeMove,
  22. "text": "{T}Text",
  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. });