FlowLayout.js 944 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /**
  2. * FlowLayout.js
  3. *
  4. * Copyright, Moxiecode Systems AB
  5. * Released under LGPL License.
  6. *
  7. * License: http://www.tinymce.com/license
  8. * Contributing: http://www.tinymce.com/contributing
  9. */
  10. /**
  11. * This layout manager will place the controls by using the browsers native layout.
  12. *
  13. * @-x-less FlowLayout.less
  14. * @class tinymce.ui.FlowLayout
  15. * @extends tinymce.ui.Layout
  16. */
  17. define("tinymce/ui/FlowLayout", [
  18. "tinymce/ui/Layout"
  19. ], function(Layout) {
  20. return Layout.extend({
  21. Defaults: {
  22. containerClass: 'flow-layout',
  23. controlClass: 'flow-layout-item',
  24. endClass : 'break'
  25. },
  26. /**
  27. * Recalculates the positions of the controls in the specified container.
  28. *
  29. * @method recalc
  30. * @param {tinymce.ui.Container} container Container instance to recalc.
  31. */
  32. recalc: function(container) {
  33. container.items().filter(':visible').each(function(ctrl) {
  34. if (ctrl.recalc) {
  35. ctrl.recalc();
  36. }
  37. });
  38. }
  39. });
  40. });