Commit 8337316ebd505fce7be8ba71623a43c52a82f6e2

Authored by Aurelio A. Heckert
1 parent 73687ba7

ActionItem891: adding documet size registration for CSS selectors.

app/views/layouts/application.rhtml
... ... @@ -59,7 +59,7 @@
59 59 " controller_"+ @controller.controller_name() +
60 60 " action_"+ @controller.controller_name() +"_"+ @controller.action_name()
61 61 %>' onload='noosfero_init();'
62   - help=<%= _('Pass the mouse over page elements to get help on them. Click the question mark icon on the top-right corner to deactivate this help window.').inspect %> >
  62 + help=<%= _('Pass the mouse over page elements to get help on them. Click the question mark icon on the top-right corner to deactivate this help window.').inspect %> onresize="registerDocumentSize()">
63 63 <script type="text/javascript">
64 64 /* Adds a class to "msie" to the body element if a Microsoft browser is
65 65 * detected. This is needed to workaround several of their limitations.
... ... @@ -68,6 +68,17 @@
68 68 document.body.className += " msie msie" +
69 69 navigator.appVersion.replace(/^.*MSIE\s+([0-9]+).*$/, "$1");
70 70 }
  71 + function registerDocumentSize() {
  72 + document.body.className = document.body.className.replace(/(^| )docSize.+( |$)/g, " ");
  73 + for ( var x=100; x<=1500; x+=100 ) {
  74 + if ( document.body.clientWidth > x ) {
  75 + document.body.className += " docSize-GT-" + x;
  76 + } else {
  77 + document.body.className += " docSize-LT-" + x;
  78 + }
  79 + }
  80 + }
  81 + registerDocumentSize();
71 82 </script>
72 83  
73 84 <% unless flash[:notice].nil? %>
... ...
public/stylesheets/menu.css
... ... @@ -167,6 +167,10 @@
167 167 width: 200px;
168 168 z-index: 100;
169 169 }
  170 +.docSize-LT-900 #user_box {
  171 + right: 165px;
  172 + width: 160px;
  173 +}
170 174  
171 175 #user_menu_head,
172 176 #user_box a,
... ...