[WIP] Update Menu [More...]
bzr revid: fme@openerp.com-20120619212212-k2yl19h2x1oan1o6
This commit is contained in:
@@ -743,6 +743,9 @@
|
||||
.openerp .oe_topbar .oe_topbar_avatar {
|
||||
vertical-align: top;
|
||||
}
|
||||
.openerp .oe_topbar .oe_cropdown_toggle:after {
|
||||
border-top: 4px solid white;
|
||||
}
|
||||
.openerp .oe_topbar .oe_cropdown_menu {
|
||||
background: #333333;
|
||||
background: rgba(37, 37, 37, 0.9);
|
||||
@@ -830,9 +833,6 @@
|
||||
list-style-type: none;
|
||||
float: left;
|
||||
}
|
||||
.openerp .oe_user_menu.oe_cropdown_toggle:after, .openerp .oe_user_menu .oe_cropdown_toggle:after {
|
||||
border-top: 4px solid white;
|
||||
}
|
||||
.openerp .oe_user_menu .oe_cropdown_menu {
|
||||
right: -1px;
|
||||
}
|
||||
@@ -875,24 +875,6 @@
|
||||
-webkit-box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset;
|
||||
box-shadow: 0 1px 2px rgba(255, 255, 255, 0.3) inset;
|
||||
}
|
||||
.openerp .oe_menu_more_container {
|
||||
position: relative;
|
||||
}
|
||||
.openerp .oe_menu_more_container .oe_menu_more {
|
||||
position: absolute;
|
||||
padding: 0;
|
||||
background-color: #646060;
|
||||
z-index: 1;
|
||||
border: 1px solid black;
|
||||
border-bottom-left-radius: 5px;
|
||||
border-bottom-right-radius: 5px;
|
||||
}
|
||||
.openerp .oe_menu_more_container .oe_menu_more li {
|
||||
float: none;
|
||||
}
|
||||
.openerp .oe_menu_more_container .oe_menu_more li a {
|
||||
white-space: nowrap;
|
||||
}
|
||||
.openerp .oe_secondary_menu_section {
|
||||
font-weight: bold;
|
||||
margin-left: 8px;
|
||||
|
||||
@@ -603,6 +603,8 @@ $colour4: #8a89ba
|
||||
@include radius(3px)
|
||||
.oe_topbar_avatar
|
||||
vertical-align: top
|
||||
.oe_cropdown_toggle:after
|
||||
border-top: 4px solid white
|
||||
.oe_cropdown_menu
|
||||
background: #333
|
||||
background: rgba(37,37,37,0.9)
|
||||
@@ -668,8 +670,6 @@ $colour4: #8a89ba
|
||||
li
|
||||
list-style-type: none
|
||||
float: left
|
||||
&.oe_cropdown_toggle:after, .oe_cropdown_toggle:after
|
||||
border-top: 4px solid white
|
||||
.oe_cropdown_menu
|
||||
right: -1px
|
||||
// }}}
|
||||
@@ -705,20 +705,6 @@ $colour4: #8a89ba
|
||||
font-weight: bold
|
||||
color: white
|
||||
@include box-shadow(0 1px 2px rgba(255,255,255,0.3) inset)
|
||||
.oe_menu_more_container
|
||||
position: relative
|
||||
.oe_menu_more
|
||||
position: absolute
|
||||
padding: 0
|
||||
background-color: #646060
|
||||
z-index: 1
|
||||
border: 1px solid black
|
||||
border-bottom-left-radius: 5px
|
||||
border-bottom-right-radius: 5px
|
||||
li
|
||||
float: none
|
||||
a
|
||||
white-space: nowrap
|
||||
.oe_secondary_menu_section
|
||||
font-weight: bold
|
||||
margin-left: 8px
|
||||
|
||||
@@ -582,10 +582,6 @@ instance.web.Menu = instance.web.Widget.extend({
|
||||
this.renderElement();
|
||||
this.limit_entries();
|
||||
this.$secondary_menus.html(QWeb.render("Menu.secondary", { widget : this }));
|
||||
this.$element.on('click', 'a.oe_menu_more_link', function() {
|
||||
self.$element.find('.oe_menu_more').toggle();
|
||||
return false;
|
||||
});
|
||||
this.$element.on('click', 'a[data-menu]', this.on_menu_click);
|
||||
this.$secondary_menus.on('click', 'a[data-menu]', this.on_menu_click);
|
||||
// Hide second level submenus
|
||||
@@ -606,16 +602,12 @@ instance.web.Menu = instance.web.Widget.extend({
|
||||
$index.after($more);
|
||||
$more.find('.oe_menu_more').append($index.next().nextAll());
|
||||
}
|
||||
this.do_hide_more();
|
||||
},
|
||||
auto_limit_entries: function() {
|
||||
// TODO: auto detect overflow and bind window on resize
|
||||
var width = $(window).width();
|
||||
return Math.floor(width / 125);
|
||||
},
|
||||
do_hide_more: function() {
|
||||
this.$element.find('.oe_menu_more').hide();
|
||||
},
|
||||
/**
|
||||
* Opens a given menu by id, as if a user had browsed to that menu by hand
|
||||
* except does not trigger any event on the way
|
||||
@@ -676,7 +668,6 @@ instance.web.Menu = instance.web.Widget.extend({
|
||||
*/
|
||||
menu_click: function(id) {
|
||||
if (id) {
|
||||
this.do_hide_more();
|
||||
// find back the menuitem in dom to get the action
|
||||
var $item = this.$element.find('a[data-menu=' + id + ']');
|
||||
if (!$item.length) {
|
||||
@@ -708,9 +699,8 @@ instance.web.Menu = instance.web.Widget.extend({
|
||||
* @param {Event} ev the jquery event
|
||||
*/
|
||||
on_menu_click: function(ev) {
|
||||
ev.preventDefault();
|
||||
this.menu_click($(ev.currentTarget).data('menu'));
|
||||
ev.stopPropagation();
|
||||
return false;
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -273,8 +273,10 @@
|
||||
</t>
|
||||
<t t-name="Menu.more">
|
||||
<li class="oe_menu_more_container">
|
||||
<a href="#" class="oe_menu_more_link oe_dropdown_toggle">More</a>
|
||||
<ul class="oe_menu_more" style="display: none;"/>
|
||||
<span class="oe_topbar_item oe_menu_more_link oe_cropdown_toggle oe_cropdown_arrow">
|
||||
More
|
||||
<ul class="oe_menu_more oe_cropdown_menu"/>
|
||||
</span>
|
||||
</li>
|
||||
</t>
|
||||
<t t-name="Menu.secondary">
|
||||
|
||||
Reference in New Issue
Block a user