Lungo.View.Resize.js 980 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. *
  3. *
  4. * @namespace LUNGO.View
  5. * @class Resize
  6. *
  7. * @author Javier Jimenez Villar <javi@tapquo.com> || @soyjavi
  8. * @author Guillermo Pascual <pasku@tapquo.com> || @pasku1
  9. */
  10. LUNGO.View.Resize = (function(lng, undefined) {
  11. var ATTRIBUTE = lng.Constants.ATTRIBUTE;
  12. /**
  13. * Sets toolbars width, using total screen width
  14. *
  15. * @method toolbars
  16. */
  17. var toolbars = function() {
  18. if (!lng.Element.toolbars)
  19. lng.Element.toolbars = lng.dom('.toolbar nav, .groupbar');
  20. var toolbars = lng.Element.toolbars;
  21. for (var i = 0, len = toolbars.length; i < len; i++) {
  22. var toolbar = lng.dom(toolbars[i]);
  23. var toolbar_children = toolbar.children();
  24. var toolbar_children_percent = 100 / toolbar.children().length;
  25. toolbar_children.style(ATTRIBUTE.WIDTH, toolbar_children_percent + ATTRIBUTE.PERCENT);
  26. }
  27. };
  28. return {
  29. toolbars: toolbars
  30. };
  31. })(LUNGO);