changeset 454:ffbd1808b4c8

fixed repo switcher, some css fixups for repo switcher and switch to menu
author Marcin Kuzminski <marcin@python-works.com>
date Fri, 03 Sep 2010 18:07:24 +0200
parents 2a95d54b19e6
children 37fb1e6d0e58
files pylons_app/public/css/style.css pylons_app/templates/base/base.html
diffstat 2 files changed, 22 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/pylons_app/public/css/style.css	Fri Sep 03 16:18:18 2010 +0200
+++ b/pylons_app/public/css/style.css	Fri Sep 03 18:07:24 2010 +0200
@@ -424,6 +424,13 @@
     z-index: 100;
 }
 
+#header #header-inner #quick ul.repo_switcher{
+    max-height:275px;
+    overflow-x:hidden;
+    overflow-y:auto;
+    white-space:nowrap;
+}
+
 #header #header-inner #quick li ul li
 {
     border-bottom: 1px solid #dddddd;   
@@ -475,6 +482,10 @@
 #header #header-inner #quick li ul ul 
 {
     right: 200px;
+    max-height: 275px;
+    overflow: auto;
+    overflow-x: hidden;
+    white-space:nowrap;    
 }
 
 #header #header-inner #quick li:hover ul ul, 
@@ -3421,6 +3432,11 @@
 	height: 25px;
 	z-index: 1;
 }
+#switch_repos select{
+    min-width:150px;
+    max-height: 250px;
+    z-index: 1;
+}
 /* -----------------------------------------------------------
     BREADCRUMBS
 ----------------------------------------------------------- */
--- a/pylons_app/templates/base/base.html	Fri Sep 03 16:18:18 2010 +0200
+++ b/pylons_app/templates/base/base.html	Fri Sep 03 18:07:24 2010 +0200
@@ -85,30 +85,7 @@
 			if selected == current:
 				return h.literal('class="current"')
 		%>
-		%if current not in ['home','admin']:
-           <script type="text/javascript">
-            YAHOO.util.Event.onDOMReady(function(){
-                YAHOO.util.Event.addListener('repo_switcher','click',function(){
-                    if(YAHOO.util.Dom.hasClass('repo_switcher','selected')){
-                        YAHOO.util.Dom.setStyle('switch_repos','display','none');
-                        YAHOO.util.Dom.setStyle('repo_switcher','background','');
-                        YAHOO.util.Dom.removeClass('repo_switcher','selected');
-                        YAHOO.util.Dom.get('repo_switcher').removeAttribute('style');
-                    }
-                    else{
-                        YAHOO.util.Dom.setStyle('switch_repos','display','');
-                        YAHOO.util.Dom.addClass('repo_switcher','selected');
-                    }
-                    });
-                YAHOO.util.Event.addListener('repos_list','change',function(e){
-                    var wa = YAHOO.util.Dom.get('repos_list').value;
-                    
-                    var url = "${h.url('summary_home',repo_name='__REPO__')}".replace('__REPO__',wa);
-                    window.location = url;
-                })
-               });
-            </script>
-            		
+		%if current not in ['home','admin']:           		
 		   ##REGULAR MENU            
 	        <ul id="quick">
 				<!-- repo switcher -->
@@ -119,13 +96,11 @@
                     </span>
                     <span>&darr;</span>					
 					</a>
-					<div id="switch_repos" style="display:none;">
-						<select id="repos_list" size="10">
-						%for repo in c.repo_switcher_list:
-							<option value="${repo}">${repo}</option>
-						%endfor
-						</select>
-					</div>			
+					<ul class="repo_switcher">
+                        %for repo in c.repo_switcher_list:
+                            <li>${h.link_to(repo,h.url('summary_home',repo_name=repo))}</li>
+                        %endfor					
+					</ul>			
 				</li>
 				
 	            <li ${is_current('summary')}>