Skip to content

Commit

Permalink
[IMP] website: improve UX for logo/font size changing
Browse files Browse the repository at this point in the history
This removes the 'V' box and it now validates the entered value when the
user clicks outside the box.

task-1952964

closes #32291

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
  • Loading branch information
jpr-odoo authored and qsm-odoo committed Apr 16, 2019
1 parent bc6a680 commit 10ce3f7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 6 additions & 3 deletions addons/website/static/src/js/widgets/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ var QuickEdit = Widget.extend({
template: 'website.theme_customize_active_input',
events: {
'keydown input': '_onInputKeydown',
'click .btn-primary': '_onSaveClick',
'click .btn-secondary': '_onResetClick',
'focusout': '_onFocusOut',
},

/**
Expand All @@ -29,6 +29,7 @@ var QuickEdit = Widget.extend({
this._super.apply(this, arguments);
this.value = value;
this.unit = unit;
this._onFocusOut = _.debounce(this._onFocusOut, 100);
},
/**
* @override
Expand Down Expand Up @@ -92,8 +93,10 @@ var QuickEdit = Widget.extend({
/**
* @private
*/
_onSaveClick: function () {
this._save();
_onFocusOut: function () {
if (!this.$el.has(document.activeElement).length) {
this._save();
}
},
/**
* @private
Expand Down
1 change: 0 additions & 1 deletion addons/website/static/src/xml/website.editor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
<input type="text" class="form-control" t-att-value="widget.value"/>
<div class="input-group-append">
<div t-if="widget.unit" class="input-group-text"><t t-esc="widget.unit"/></div>
<button type="button" class="btn btn-primary fa fa-check" title="Save"/>
<button type="button" class="btn btn-secondary fa fa-undo" title="Reset"/>
</div>
</div>
Expand Down

0 comments on commit 10ce3f7

Please sign in to comment.