Commit 8337316ebd505fce7be8ba71623a43c52a82f6e2
1 parent
73687ba7
Exists in
master
and in
28 other branches
ActionItem891: adding documet size registration for CSS selectors.
Showing
2 changed files
with
16 additions
and
1 deletions
Show diff stats
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? %> | ... | ... |