3769653a2fdb9bc4f58afb07f48b16a0d6b591b1.svn-base 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * Ext JS Library 2.0 Copyright(c) 2006-2007, Ext JS, LLC. licensing@extjs.com
  3. *
  4. * http://extjs.com/license
  5. */
  6. var ResizableExample = {
  7. init : function() {
  8. var basic = new Ext.Resizable('basic', {
  9. width : 200,
  10. height : 100,
  11. minWidth : 100,
  12. minHeight : 50
  13. });
  14. var animated = new Ext.Resizable('animated', {
  15. width : 200,
  16. pinned : true,
  17. height : 100,
  18. minWidth : 100,
  19. minHeight : 50,
  20. animate : true,
  21. easing : 'backIn',
  22. duration : .6
  23. });
  24. var wrapped = new Ext.Resizable('wrapped', {
  25. wrap : true,
  26. pinned : true,
  27. minWidth : 50,
  28. minHeight : 50,
  29. preserveRatio : true
  30. });
  31. var transparent = new Ext.Resizable('transparent', {
  32. wrap : true,
  33. minWidth : 50,
  34. minHeight : 50,
  35. preserveRatio : true,
  36. transparent : true
  37. });
  38. var custom = new Ext.Resizable('custom', {
  39. wrap : true,
  40. pinned : true,
  41. minWidth : 50,
  42. minHeight : 50,
  43. preserveRatio : true,
  44. handles : 'all',
  45. draggable : true,
  46. dynamic : true
  47. });
  48. var customEl = custom.getEl();
  49. // move to the body to prevent overlap on my blog
  50. document.body.insertBefore(customEl.dom, document.body.firstChild);
  51. customEl.on('dblclick', function() {
  52. customEl.hide(true);
  53. });
  54. customEl.hide();
  55. Ext.get('showMe').on('click', function() {
  56. customEl.center();
  57. customEl.show(true);
  58. });
  59. var dwrapped = new Ext.Resizable('dwrapped', {
  60. wrap : true,
  61. pinned : true,
  62. width : 450,
  63. height : 150,
  64. minWidth : 200,
  65. minHeight : 50,
  66. dynamic : true
  67. });
  68. var snap = new Ext.Resizable('snap', {
  69. pinned : true,
  70. width : 250,
  71. height : 100,
  72. handles : 'e',
  73. widthIncrement : 50,
  74. minWidth : 50,
  75. dynamic : true
  76. });
  77. }
  78. };
  79. Ext.EventManager.onDocumentReady(ResizableExample.init, ResizableExample, true);