[IMP] pos_restaurant: table label editing
This commit is contained in:
committed by
Frédéric van der Essen
parent
fcde32d180
commit
539dc53ebd
@@ -55,6 +55,10 @@
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.floor-map .table .label {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
}
|
||||
.floor-map .table.selected {
|
||||
outline: solid rgba(255,255,255,0.3);
|
||||
cursor: move;
|
||||
|
||||
@@ -137,8 +137,10 @@ function openerp_restaurant_floors(instance,module){
|
||||
this.renderElement();
|
||||
},
|
||||
set_table_name: function(name){
|
||||
this.table.name = name;
|
||||
this.renderElement();
|
||||
if (name) {
|
||||
this.table.name = name;
|
||||
this.renderElement();
|
||||
}
|
||||
},
|
||||
table_style: function(){
|
||||
var table = this.table;
|
||||
@@ -269,6 +271,18 @@ function openerp_restaurant_floors(instance,module){
|
||||
tool_colorpicker_close: function(){
|
||||
this.$('.color-picker').addClass('oe_hidden');
|
||||
},
|
||||
tool_rename_table: function(){
|
||||
var self = this;
|
||||
if (this.selected_table) {
|
||||
this.pos_widget.screen_selector.show_popup('textinput',{
|
||||
'message':'Table Name ?',
|
||||
'value': this.selected_table.table.name,
|
||||
'confirm': function(value) {
|
||||
self.selected_table.set_table_name(value);
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
tool_duplicate_table: function(){
|
||||
if (this.selected_table) {
|
||||
var tw = this.create_table(this.selected_table.table);
|
||||
@@ -357,6 +371,10 @@ function openerp_restaurant_floors(instance,module){
|
||||
this.$('.edit-button.new-table').click(function(event){
|
||||
self.tool_new_table();
|
||||
});
|
||||
|
||||
this.$('.edit-button.rename').click(function(event){
|
||||
self.tool_rename_table();
|
||||
});
|
||||
|
||||
this.$('.color-picker .close-picker').click(function(event){
|
||||
self.tool_colorpicker_close();
|
||||
|
||||
@@ -3,11 +3,17 @@
|
||||
|
||||
<t t-name="TableWidget">
|
||||
<t t-if='!widget.selected'>
|
||||
<div class='table' t-att-style='widget.table_style_str()'><t t-esc='widget.table.name' /></div>
|
||||
<div class='table' t-att-style='widget.table_style_str()'>
|
||||
<span class='label'>
|
||||
<t t-esc='widget.table.name' />
|
||||
</span>
|
||||
</div>
|
||||
</t>
|
||||
<t t-if='widget.selected'>
|
||||
<div class='table selected' t-att-style='widget.table_style_str()'>
|
||||
<t t-esc='widget.table.name' />
|
||||
<span class='label'>
|
||||
<t t-esc='widget.table.name' />
|
||||
</span>
|
||||
<span class='table-handle top'></span>
|
||||
<span class='table-handle bottom'></span>
|
||||
<span class='table-handle left'></span>
|
||||
@@ -42,7 +48,7 @@
|
||||
<span class='edit-button dup-table needs-selection'>
|
||||
<i class='fa fa-copy'></i>
|
||||
</span>
|
||||
<span class='edit-button text needs-selection'>
|
||||
<span class='edit-button rename needs-selection'>
|
||||
<i class='fa fa-font'></i>
|
||||
</span>
|
||||
<span class='edit-button shape needs-selection'>
|
||||
|
||||
Reference in New Issue
Block a user