Portlet.js 931 B

1234567891011121314151617181920212223242526272829303132333435
  1. /**
  2. * @class Ext.app.Portlet
  3. * @extends Ext.panel.Panel
  4. * A {@link Ext.panel.Panel Panel} class that is managed by {@link Ext.app.PortalPanel}.
  5. */
  6. Ext.define('Ext.app.Portlet', {
  7. extend: 'Ext.panel.Panel',
  8. alias: 'widget.portlet',
  9. layout: 'fit',
  10. anchor: '100%',
  11. frame: true,
  12. closable: true,
  13. collapsible: true,
  14. animCollapse: true,
  15. draggable: {
  16. moveOnDrag: false
  17. },
  18. cls: 'x-portlet',
  19. // Override Panel's default doClose to provide a custom fade out effect
  20. // when a portlet is removed from the portal
  21. doClose: function() {
  22. if (!this.closing) {
  23. this.closing = true;
  24. this.el.animate({
  25. opacity: 0,
  26. callback: function(){
  27. this.fireEvent('close', this);
  28. this[this.closeAction]();
  29. },
  30. scope: this
  31. });
  32. }
  33. }
  34. });