[IMP] point_of_sale: new textarea popup
This commit is contained in:
committed by
Frédéric van der Essen
parent
07c07b2a34
commit
3d5eeb5da4
@@ -402,6 +402,7 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
|
||||
module.SelectionPopupWidget = module.PopUpWidget.extend({
|
||||
template: 'SelectionPopupWidget',
|
||||
show: function(options){
|
||||
options = options || {};
|
||||
var self = this;
|
||||
this._super();
|
||||
|
||||
@@ -430,6 +431,7 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
|
||||
module.TextInputPopupWidget = module.PopUpWidget.extend({
|
||||
template: 'TextInputPopupWidget',
|
||||
show: function(options){
|
||||
options = options || {};
|
||||
var self = this;
|
||||
this._super();
|
||||
|
||||
@@ -437,7 +439,7 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
|
||||
this.comment = options.comment || '';
|
||||
this.value = options.value || '';
|
||||
this.renderElement();
|
||||
this.$('input').focus();
|
||||
this.$('input,textarea').focus();
|
||||
|
||||
this.$('.button.cancel').click(function(){
|
||||
self.pos_widget.screen_selector.close_popup();
|
||||
@@ -448,7 +450,7 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
|
||||
|
||||
this.$('.button.confirm').click(function(){
|
||||
self.pos_widget.screen_selector.close_popup();
|
||||
var value = self.$('input').val();
|
||||
var value = self.$('input,textarea').val();
|
||||
if( options.confirm ){
|
||||
options.confirm.call(self,value);
|
||||
}
|
||||
@@ -456,6 +458,10 @@ function openerp_pos_screens(instance, module){ //module is instance.point_of_sa
|
||||
},
|
||||
});
|
||||
|
||||
module.TextAreaPopupWidget = module.TextInputPopupWidget.extend({
|
||||
template: 'TextAreaPopupWidget',
|
||||
});
|
||||
|
||||
module.ErrorNoClientPopupWidget = module.ErrorPopupWidget.extend({
|
||||
template: 'ErrorNoClientPopupWidget',
|
||||
});
|
||||
|
||||
@@ -1014,6 +1014,9 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
|
||||
this.textinput_popup = new module.TextInputPopupWidget(this,{});
|
||||
this.textinput_popup.appendTo(this.$el);
|
||||
|
||||
this.textarea_popup = new module.TextAreaPopupWidget(this,{});
|
||||
this.textarea_popup.appendTo(this.$el);
|
||||
|
||||
this.unsent_orders_popup = new module.UnsentOrdersPopupWidget(this,{});
|
||||
this.unsent_orders_popup.appendTo(this.$el);
|
||||
|
||||
@@ -1084,6 +1087,7 @@ function openerp_pos_widgets(instance, module){ //module is instance.point_of_sa
|
||||
'error-barcode': this.error_barcode_popup,
|
||||
'error-traceback': this.error_traceback_popup,
|
||||
'textinput': this.textinput_popup,
|
||||
'textarea': this.textarea_popup,
|
||||
'confirm': this.confirm_popup,
|
||||
'fullscreen': this.fullscreen_popup,
|
||||
'selection': this.selection_popup,
|
||||
|
||||
@@ -935,6 +935,23 @@
|
||||
</div>
|
||||
</t>
|
||||
|
||||
<t t-name="TextAreaPopupWidget">
|
||||
<div class="modal-dialog">
|
||||
<div class="popup popup-textinput">
|
||||
<p class="message"><t t-esc=" widget.message || '' " /></p>
|
||||
<textarea rows="15" cols="50" t-att-value="widget.value || ''"></textarea>
|
||||
<div class="footer">
|
||||
<div class="button confirm">
|
||||
Ok
|
||||
</div>
|
||||
<div class="button cancel">
|
||||
Cancel
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
<t t-name="UnsentOrdersPopupWidget">
|
||||
<div class="modal-dialog">
|
||||
<div class="popup popup-unsent-orders">
|
||||
|
||||
Reference in New Issue
Block a user