Skip to content
Permalink
Browse files

[IMP] website: improve UX for logo/font size changing

This removes the 'V' box and it now validates the entered value when the
user clicks outside the box.

task-1952964
  • Loading branch information...
jpr-odoo authored and qsm-odoo committed Mar 20, 2019
1 parent bc6a680 commit 91ae1d6d4a16bc1b6fa85caf6ff009cedf6e2bc8
@@ -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',
},

/**
@@ -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
@@ -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
@@ -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>

0 comments on commit 91ae1d6

Please sign in to comment.
You can’t perform that action at this time.