diff options
| author | Frederic van der Essen <fva@openerp.com / fvdessen+o@gmail.com> | 2014-09-25 12:03:52 +0200 |
|---|---|---|
| committer | Frédéric van der Essen <fvdessen@gmail.com> | 2014-11-25 17:28:09 +0100 |
| commit | 539dc53ebd9cc89b955fcbd482eb2b281a79d930 (patch) | |
| tree | a7a84bbe49924239002ee3a650584aaa6eee53d4 /addons | |
| parent | fcde32d1802bc1458e0f7ee315caf3463e89f808 (diff) | |
[IMP] pos_restaurant: table label editing
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/pos_restaurant/static/src/css/restaurant.css | 4 | ||||
| -rw-r--r-- | addons/pos_restaurant/static/src/js/floors.js | 22 | ||||
| -rw-r--r-- | addons/pos_restaurant/static/src/xml/floors.xml | 12 |
3 files changed, 33 insertions, 5 deletions
diff --git a/addons/pos_restaurant/static/src/css/restaurant.css b/addons/pos_restaurant/static/src/css/restaurant.css index bdef15c7f47..825c824bd83 100644 --- a/addons/pos_restaurant/static/src/css/restaurant.css +++ b/addons/pos_restaurant/static/src/css/restaurant.css @@ -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; diff --git a/addons/pos_restaurant/static/src/js/floors.js b/addons/pos_restaurant/static/src/js/floors.js index 40b9f17773c..89143e34575 100644 --- a/addons/pos_restaurant/static/src/js/floors.js +++ b/addons/pos_restaurant/static/src/js/floors.js @@ -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(); diff --git a/addons/pos_restaurant/static/src/xml/floors.xml b/addons/pos_restaurant/static/src/xml/floors.xml index 9407c00ede2..668aeaaf7c3 100644 --- a/addons/pos_restaurant/static/src/xml/floors.xml +++ b/addons/pos_restaurant/static/src/xml/floors.xml @@ -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'> |
