summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-12-02 19:01:39 +0000
committerGerrit Code Review <review@openstack.org>2015-12-02 19:01:39 +0000
commit07ac5e2e505cdc5a8046e6319f859347eeb1cf5a (patch)
treec10c58d7939afc09df11f33d1fa82634dbe9485d
parenta48491b3e2b004c743e91b124934aeb2e8fa021d (diff)
parentdab7e45c7456fb5b4e9a9235507dba934b995c1e (diff)
Merge "Fix for the broken header's dropdowns for both v0.11.2 and v0.13"
-rw-r--r--horizon/static/framework/framework.module.js22
-rw-r--r--horizon/templates/horizon/common/_region_selector.html2
-rw-r--r--openstack_dashboard/templates/_header.html4
-rw-r--r--openstack_dashboard/themes/material/templates/_header.html4
4 files changed, 26 insertions, 6 deletions
diff --git a/horizon/static/framework/framework.module.js b/horizon/static/framework/framework.module.js
index 2785622..5d5617d 100644
--- a/horizon/static/framework/framework.module.js
+++ b/horizon/static/framework/framework.module.js
@@ -10,13 +10,14 @@
10 .config(config); 10 .config(config);
11 11
12 config.$inject = [ 12 config.$inject = [
13 '$injector',
13 '$provide', 14 '$provide',
14 '$interpolateProvider', 15 '$interpolateProvider',
15 '$httpProvider', 16 '$httpProvider',
16 '$windowProvider' 17 '$windowProvider'
17 ]; 18 ];
18 19
19 function config($provide, $interpolateProvider, $httpProvider, $windowProvider) { 20 function config($injector, $provide, $interpolateProvider, $httpProvider, $windowProvider) {
20 21
21 var path = $windowProvider.$get().STATIC_URL + 'framework/'; 22 var path = $windowProvider.$get().STATIC_URL + 'framework/';
22 $provide.constant('horizon.framework.basePath', path); 23 $provide.constant('horizon.framework.basePath', path);
@@ -32,6 +33,25 @@
32 $httpProvider.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 33 $httpProvider.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
33 $httpProvider.defaults.headers.common['Content-Type'] = 'application/json;charset=utf-8'; 34 $httpProvider.defaults.headers.common['Content-Type'] = 'application/json;charset=utf-8';
34 35
36 // NOTE(tsufiev): angular-ui/bootstrap v0.11.2 dropdownToggle directive
37 // conflicts with the native Bootstrap data-toggle="dropdown" attribute
38 // (see https://github.com/angular-ui/bootstrap/issues/2156).
39 // This is fixed in 0.13, but before that it'd be valuable to ensure that
40 // the same html markup works the same way with both versions of
41 // angular-ui/bootstrap (0.11.2 and 0.13). Could be safely deleted once
42 // Horizon migrates to angular-ui/bootstra v0.13
43 if ($injector.has('dropdownToggleDirective')) {
44 $provide.decorator('dropdownToggleDirective', patchDropdowns);
45 }
46
47 patchDropdowns.$inject = ['$delegate'];
48
49 function patchDropdowns($delegate) {
50 var directive = $delegate[0];
51 directive.restrict = 'A';
52 return $delegate;
53 }
54
35 // Global http error handler 55 // Global http error handler
36 // if user is not authorized, log user out 56 // if user is not authorized, log user out
37 // this can happen when session expires 57 // this can happen when session expires
diff --git a/horizon/templates/horizon/common/_region_selector.html b/horizon/templates/horizon/common/_region_selector.html
index bbcd9f6..63762eb 100644
--- a/horizon/templates/horizon/common/_region_selector.html
+++ b/horizon/templates/horizon/common/_region_selector.html
@@ -1,5 +1,5 @@
1{% if regions.support %} 1{% if regions.support %}
2 <a href="#" class="dropdown-toggle" role="button" aria-expanded="false"> 2 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
3 {{ regions.current.name }} 3 {{ regions.current.name }}
4 <span class="fa fa-caret-down"></span> 4 <span class="fa fa-caret-down"></span>
5 </a> 5 </a>
diff --git a/openstack_dashboard/templates/_header.html b/openstack_dashboard/templates/_header.html
index 8d0a115..8e20473 100644
--- a/openstack_dashboard/templates/_header.html
+++ b/openstack_dashboard/templates/_header.html
@@ -20,7 +20,7 @@
20 <div class="collapse navbar-collapse" id="navbar-collapse"> 20 <div class="collapse navbar-collapse" id="navbar-collapse">
21 <ul class="nav navbar-nav"> 21 <ul class="nav navbar-nav">
22 <li class="dropdown"> 22 <li class="dropdown">
23 <a href="#" class="dropdown-toggle" role="button" aria-expanded="false"> 23 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
24 {% show_overview %} 24 {% show_overview %}
25 <span class="fa fa-caret-down"></span> 25 <span class="fa fa-caret-down"></span>
26 </a> 26 </a>
@@ -54,7 +54,7 @@
54 54
55 <ul class="nav navbar-nav navbar-right"> 55 <ul class="nav navbar-nav navbar-right">
56 <li class="dropdown"> 56 <li class="dropdown">
57 <a href="#" class="dropdown-toggle" role="button" aria-expanded="false"> 57 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
58 <span class="fa fa-user"></span> 58 <span class="fa fa-user"></span>
59 {{ request.user.username }} 59 {{ request.user.username }}
60 <span class="fa fa-caret-down"></span> 60 <span class="fa fa-caret-down"></span>
diff --git a/openstack_dashboard/themes/material/templates/_header.html b/openstack_dashboard/themes/material/templates/_header.html
index 1ea3a1f..01ceb83 100644
--- a/openstack_dashboard/themes/material/templates/_header.html
+++ b/openstack_dashboard/themes/material/templates/_header.html
@@ -29,7 +29,7 @@
29 <div class="collapse navbar-collapse" id="navbar-collapse"> 29 <div class="collapse navbar-collapse" id="navbar-collapse">
30 <ul class="nav navbar-nav"> 30 <ul class="nav navbar-nav">
31 <li class="dropdown"> 31 <li class="dropdown">
32 <a href="#" class="dropdown-toggle" role="button" aria-expanded="false"> 32 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
33 {% show_overview %} 33 {% show_overview %}
34 <span class="fa fa-caret-down"></span> 34 <span class="fa fa-caret-down"></span>
35 </a> 35 </a>
@@ -63,7 +63,7 @@
63 63
64 <ul class="nav navbar-nav navbar-right"> 64 <ul class="nav navbar-nav navbar-right">
65 <li class="dropdown"> 65 <li class="dropdown">
66 <a href="#" class="dropdown-toggle" role="button" aria-expanded="false"> 66 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
67 <span class="fa fa-user"></span> 67 <span class="fa fa-user"></span>
68 {{ request.user.username }} 68 {{ request.user.username }}
69 <span class="fa fa-caret-down"></span> 69 <span class="fa fa-caret-down"></span>