[MERGE] Merge trunk
bzr revid: fme@openerp.com-20120328102916-hietshrabuomha3w
This commit is contained in:
@@ -167,6 +167,24 @@
|
||||
-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;
|
||||
}
|
||||
.openerp2 .oe_menu_more_container {
|
||||
position: relative;
|
||||
}
|
||||
.openerp2 .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;
|
||||
}
|
||||
.openerp2 .oe_menu_more_container .oe_menu_more li {
|
||||
float: none;
|
||||
}
|
||||
.openerp2 .oe_menu_more_container .oe_menu_more li a {
|
||||
white-space: nowrap;
|
||||
}
|
||||
.openerp2 .oe_secondary_menu_section {
|
||||
font-weight: bold;
|
||||
margin-left: 8px;
|
||||
@@ -250,19 +268,10 @@
|
||||
border-right: 4px solid transparent;
|
||||
border-top: 4px solid #4c4c4c;
|
||||
}
|
||||
.openerp2 .oe_user_menu {
|
||||
float: right;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
.openerp2 .oe_user_menu li {
|
||||
list-style-type: none;
|
||||
float: left;
|
||||
}
|
||||
.openerp2 .oe_user_menu .oe_dropdown {
|
||||
.openerp2 .oe_dropdown {
|
||||
position: relative;
|
||||
}
|
||||
.openerp2 .oe_user_menu .oe_dropdown_toggle:after {
|
||||
.openerp2 .oe_dropdown_toggle:after {
|
||||
width: 0;
|
||||
height: 0;
|
||||
display: inline-block;
|
||||
@@ -277,6 +286,15 @@
|
||||
filter: alpha(opacity=50);
|
||||
opacity: 0.5;
|
||||
}
|
||||
.openerp2 .oe_user_menu {
|
||||
float: right;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
.openerp2 .oe_user_menu li {
|
||||
list-style-type: none;
|
||||
float: left;
|
||||
}
|
||||
.openerp2 .oe_user_menu .oe_dropdown_options {
|
||||
float: left;
|
||||
background: #333333;
|
||||
|
||||
@@ -194,6 +194,20 @@ $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
|
||||
@@ -260,6 +274,23 @@ $colour4: #8a89ba
|
||||
border-top: 4px solid #4c4c4c
|
||||
// }}}
|
||||
// UserMenu {{{
|
||||
.oe_dropdown
|
||||
position: relative
|
||||
|
||||
.oe_dropdown_toggle:after
|
||||
width: 0
|
||||
height: 0
|
||||
display: inline-block
|
||||
content: "&darr"
|
||||
text-indent: -99999px
|
||||
vertical-align: top
|
||||
margin-top: 8px
|
||||
margin-left: 4px
|
||||
border-left: 4px solid transparent
|
||||
border-right: 4px solid transparent
|
||||
border-top: 4px solid white
|
||||
@include opacity(0.5)
|
||||
|
||||
.oe_user_menu
|
||||
float: right
|
||||
padding: 0
|
||||
@@ -267,22 +298,6 @@ $colour4: #8a89ba
|
||||
li
|
||||
list-style-type: none
|
||||
float: left
|
||||
.oe_dropdown
|
||||
position: relative
|
||||
|
||||
.oe_dropdown_toggle:after
|
||||
width: 0
|
||||
height: 0
|
||||
display: inline-block
|
||||
content: "&darr"
|
||||
text-indent: -99999px
|
||||
vertical-align: top
|
||||
margin-top: 8px
|
||||
margin-left: 4px
|
||||
border-left: 4px solid transparent
|
||||
border-right: 4px solid transparent
|
||||
border-top: 4px solid white
|
||||
@include opacity(0.5)
|
||||
|
||||
.oe_dropdown_options
|
||||
float: left
|
||||
|
||||
@@ -635,11 +635,13 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{
|
||||
init: function() {
|
||||
this._super.apply(this, arguments);
|
||||
this.has_been_loaded = $.Deferred();
|
||||
this.maximum_visible_links = 'auto'; // # of menu to show. 0 = do not crop, 'auto' = algo
|
||||
},
|
||||
start: function() {
|
||||
this._super.apply(this, arguments);
|
||||
this.$secondary_menus = this.getParent().$element.find('.oe_secondary_menus_container');
|
||||
this.$secondary_menus.on('click', 'a[data-menu]', this.on_menu_click);
|
||||
$('html').bind('click', this.do_hide_more);
|
||||
},
|
||||
do_reload: function() {
|
||||
var self = this;
|
||||
@@ -650,14 +652,40 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{
|
||||
});
|
||||
},
|
||||
on_loaded: function(data) {
|
||||
var self = this;
|
||||
this.data = data;
|
||||
this.renderElement();
|
||||
this.limit_entries();
|
||||
this.$element.on('click', 'a[data-menu]', this.on_menu_click);
|
||||
this.$element.on('click', 'a.oe_menu_more_link', function() {
|
||||
self.$element.find('.oe_menu_more').toggle();
|
||||
return false;
|
||||
});
|
||||
this.$secondary_menus.html(QWeb.render("Menu.secondary", { widget : this }));
|
||||
// Hide second level submenus
|
||||
this.$secondary_menus.find('.oe_menu_toggler').siblings('.oe_secondary_submenu').hide();
|
||||
this.has_been_loaded.resolve();
|
||||
},
|
||||
limit_entries: function() {
|
||||
var maximum_visible_links = this.maximum_visible_links;
|
||||
if (maximum_visible_links === 'auto') {
|
||||
maximum_visible_links = this.auto_limit_entries();
|
||||
}
|
||||
if (maximum_visible_links) {
|
||||
var $more = $(QWeb.render('Menu.more')),
|
||||
$index = this.$element.find('li').eq(maximum_visible_links - 1);
|
||||
$index.after($more);
|
||||
$more.find('.oe_menu_more').append($index.next().nextAll());
|
||||
}
|
||||
},
|
||||
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
|
||||
@@ -702,6 +730,7 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{
|
||||
}
|
||||
},
|
||||
on_menu_click: function(ev, id) {
|
||||
this.do_hide_more();
|
||||
id = id || 0;
|
||||
var $clicked_menu, manual = false;
|
||||
|
||||
|
||||
@@ -1785,7 +1785,7 @@ openerp.web.form.FieldFloat = openerp.web.form.FieldChar.extend({
|
||||
this._super(view, node);
|
||||
this.value = 0;
|
||||
if (this.node.attrs.digits) {
|
||||
this.digits = py.eval(this.node.attrs.digits).toJSON();
|
||||
this.digits = py.eval(node.attrs.digits);
|
||||
} else {
|
||||
this.digits = this.field.digits;
|
||||
}
|
||||
|
||||
@@ -63,11 +63,10 @@ openerp.web.page = function (openerp) {
|
||||
return def.promise();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
openerp.web.FormRenderingEngineReadonly = openerp.web.FormRenderingEngine.extend({
|
||||
alter_field: function(field) {
|
||||
field.set({"force_readonly": true});
|
||||
},
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
@@ -763,7 +763,7 @@ session.web.ViewManagerAction = session.web.ViewManager.extend(/** @lends oepner
|
||||
_(log_records.reverse()).each(function (record) {
|
||||
var context = {};
|
||||
if (record.context) {
|
||||
try { context = py.eval(record.context).toJSON(); }
|
||||
try { context = py.eval(record.context); }
|
||||
catch (e) { /* TODO: what do I do now? */ }
|
||||
}
|
||||
$(_.str.sprintf('<li><a href="#">%s</a></li>', record.name))
|
||||
|
||||
@@ -335,6 +335,12 @@
|
||||
</li>
|
||||
</ul>
|
||||
</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;"/>
|
||||
</li>
|
||||
</t>
|
||||
<t t-name="Menu.secondary">
|
||||
<div t-foreach="widget.data.data.children" t-as="menu" style="display: none" class="oe_secondary_menu" t-att-data-menu-parent="menu.id">
|
||||
<t t-foreach="menu.children" t-as="menu">
|
||||
|
||||
Reference in New Issue
Block a user