not really known
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.

49 lines
1.3 KiB

  1. /**
  2. _enyo.CardArranger_ is an <a href="#enyo.Arranger">enyo.Arranger</a> that
  3. displays only one active control. The non-active controls are hidden with
  4. _setShowing(false)_. Transitions between arrangements are handled by fading
  5. from one control to the next.
  6. */
  7. enyo.kind({
  8. name: "enyo.CardArranger",
  9. kind: "Arranger",
  10. layoutClass: "enyo-arranger enyo-arranger-fit",
  11. calcArrangementDifference: function(inI0, inA0, inI1, inA1) {
  12. return this.containerBounds.width;
  13. },
  14. arrange: function(inC, inName) {
  15. for (var i=0, c, b, v; c=inC[i]; i++) {
  16. v = (i == 0) ? 1 : 0;
  17. this.arrangeControl(c, {opacity: v});
  18. }
  19. },
  20. start: function() {
  21. this.inherited(arguments);
  22. var c$ = this.container.getPanels();
  23. for (var i=0, c; c=c$[i]; i++) {
  24. var wasShowing=c.showing;
  25. c.setShowing(i == this.container.fromIndex || i == (this.container.toIndex));
  26. if (c.showing && !wasShowing) {
  27. c.resized();
  28. }
  29. }
  30. },
  31. finish: function() {
  32. this.inherited(arguments);
  33. var c$ = this.container.getPanels();
  34. for (var i=0, c; c=c$[i]; i++) {
  35. c.setShowing(i == this.container.toIndex);
  36. }
  37. },
  38. destroy: function() {
  39. var c$ = this.container.getPanels();
  40. for (var i=0, c; c=c$[i]; i++) {
  41. enyo.Arranger.opacifyControl(c, 1);
  42. if (!c.showing) {
  43. c.setShowing(true);
  44. }
  45. }
  46. this.inherited(arguments);
  47. }
  48. });