openerp.openerp_pos_widgets = function (instance, module) {
module.OrderWidget = module.PosBaseWidget.extend({
renderElement: function() {
var self = this;
this._super();
// freeing subwidgets
if(this.scrollbar){
this.scrollbar.destroy();
}
var height = document.getElementById("paypad").offsetHeight;
$('.point-of-sale .order-container').css({'bottom': height});
for(var i = 0, len = this.orderlinewidgets.length; i < len; i++){
this.orderlinewidgets[i].destroy();
}
this.orderlinewidgets = [];
if(this.display_mode === 'maximized'){
$('.point-of-sale .order-container').css({'bottom':'0px'});
}else if(this.display_mode === 'actionbar'){
$('.point-of-sale .order-container').css({'bottom':'105px'});
}else if(this.display_mode !== 'numpad'){
console.error('ERROR: OrderWidget renderElement(): wrong display_mode:',this.display_mode);
}var $content = this.$('.orderlines');
this.currentOrderLines.each(_.bind( function(orderLine) {
var line = new module.OrderlineWidget(this, {
model: orderLine,
order: this.pos.get('selectedOrder'),
});
line.on('order_line_selected', self, self.update_numpad);
line.on('order_line_refreshed', self, self.update_summary);
line.appendTo($content);
self.orderlinewidgets.push(line);
}, this));
this.update_numpad();
this.update_summary();
var position = this.scrollbar ? this.scrollbar.get_position() : 0;
var at_bottom = this.scrollbar ? this.scrollbar.is_at_bottom() : false;
this.scrollbar = new module.ScrollbarWidget(this,{
target_widget: this,
target_selector: '.order-scroller',
name: 'order',
track_bottom: true,
on_show: function(){
self.$('.order-scroller').css({'width':'89%'},100);
},
on_hide: function(){
self.$('.order-scroller').css({'width':'100%'},100);
},
});this.scrollbar.replace(this.$('.placeholder-ScrollbarWidget'));
this.scrollbar.set_position(position);if( at_bottom ){
this.scrollbar.set_position(Number.MAX_VALUE, false);
}}
})
}
I make a new module
add var height = document.getElementById("paypad").offsetHeight;
$('.point-of-sale .order-container').css({'bottom': height});
to OrderWidget
and add js['static/src/js/auto_height.js']
But it not works
sloved