A Qcodo based CMS/ecommerce framework
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.2 KiB

12 years ago
  1. ///////////////////////////////
  2. // Control Handle Functionality
  3. ///////////////////////////////
  4. qcodo.registerControlHandle = function(mixControl, strCursor) {
  5. var objControl; if (!(objControl = qcodo.getControl(mixControl))) return;
  6. var objWrapper = objControl.wrapper;
  7. if (!objWrapper.handle) {
  8. var objHandle = document.createElement("span");
  9. objHandle.id = objWrapper.id + "handle";
  10. objWrapper.parentNode.appendChild(objHandle);
  11. objWrapper.handle = objHandle;
  12. objHandle.wrapper = objWrapper;
  13. if (!objWrapper.style.position) {
  14. // The Wrapper is not defined as Positioned Relatively or Absolutely
  15. // Therefore, no offsetTop/Left/Width/Height values are available on the wrapper itself
  16. objHandle.style.width = objWrapper.control.style.width;
  17. objHandle.style.height = objWrapper.control.style.height;
  18. objHandle.style.top = objWrapper.control.offsetTop + "px";
  19. objHandle.style.left = objWrapper.control.offsetLeft + "px";
  20. } else {
  21. objHandle.style.width = objWrapper.offsetWidth + "px";
  22. objHandle.style.height = objWrapper.offsetHeight + "px";
  23. objHandle.style.top = objWrapper.offsetTop + "px";
  24. objHandle.style.left = objWrapper.offsetLeft + "px";
  25. };
  26. objHandle.style.cursor = strCursor;
  27. objHandle.style.zIndex = 999;
  28. objHandle.style.backgroundColor = "white";
  29. if (qcodo.isBrowser(qcodo.IE))
  30. objHandle.style.filter = "alpha(opacity=0)";
  31. else
  32. objHandle.style.opacity = 0.0;
  33. objHandle.style.position = "absolute";
  34. objHandle.style.fontSize = "1px";
  35. objHandle.innerHTML = ".";
  36. };
  37. objWrapper.updateHandle = function(blnUpdateParent, strCursor) {
  38. var objHandle = this.handle;
  39. // Make Sure the Wrapper's Parent owns this Handle
  40. if (blnUpdateParent)
  41. this.parentNode.appendChild(objHandle);
  42. // Fixup Size and Positioning
  43. objHandle.style.top = this.offsetTop + "px";
  44. objHandle.style.left = this.offsetLeft + "px";
  45. objHandle.style.width = this.offsetWidth + "px";
  46. objHandle.style.height = this.offsetHeight + "px";
  47. // Update the Cursor
  48. if (strCursor)
  49. objHandle.style.cursor = strCursor;
  50. };
  51. };
  52. //////////////////
  53. // Qcodo Shortcuts
  54. //////////////////
  55. qc.regCH = qcodo.registerControlHandle;