Skip to content

Commit 74628cd

Browse files
author
olysenko
committed
Merge remote-tracking branch 'mainline/2.2-develop' into MAGETWO-89264
2 parents 84d8c71 + 1b52d8c commit 74628cd

File tree

5 files changed

+79
-4
lines changed

5 files changed

+79
-4
lines changed

app/code/Magento/Customer/view/frontend/templates/form/login.phtml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,13 @@
4242
</form>
4343
</div>
4444
</div>
45+
46+
<script type="text/x-magento-init">
47+
{
48+
".field.email": {
49+
"Magento_Customer/js/trim-username": {
50+
"formSelector": "form.form-login"
51+
}
52+
}
53+
}
54+
</script>
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
define([
7+
'jquery'
8+
], function ($) {
9+
'use strict';
10+
11+
$.widget('mage.trimUsername', {
12+
options: {
13+
cache: {},
14+
formSelector: 'form',
15+
emailSelector: 'input[type="email"]'
16+
},
17+
18+
/**
19+
* Widget initialization
20+
* @private
21+
*/
22+
_create: function () {
23+
// We need to look outside the module for backward compatibility, since someone can already use the module.
24+
// @todo Narrow this selector in 2.3 so it doesn't accidentally finds the the email field from the
25+
// newsletter email field or any other "email" field.
26+
this.options.cache.email = $(this.options.formSelector).find(this.options.emailSelector);
27+
this._bind();
28+
},
29+
30+
/**
31+
* Event binding, will monitor change, keyup and paste events.
32+
* @private
33+
*/
34+
_bind: function () {
35+
if (this.options.cache.email.length) {
36+
this._on(this.options.cache.email, {
37+
'change': this._trimUsername,
38+
'keyup': this._trimUsername,
39+
'paste': this._trimUsername
40+
});
41+
}
42+
},
43+
44+
/**
45+
* Trim username
46+
* @private
47+
*/
48+
_trimUsername: function () {
49+
var username = this._getUsername().trim();
50+
51+
this.options.cache.email.val(username);
52+
},
53+
54+
/**
55+
* Get username value
56+
* @returns {*}
57+
* @private
58+
*/
59+
_getUsername: function () {
60+
return this.options.cache.email.val();
61+
}
62+
});
63+
64+
return $.mage.trimUsername;
65+
});

app/code/Magento/GoogleAnalytics/view/frontend/web/js/google-analytics.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ define([
5353
}
5454

5555
// Process orders data
56-
if (config.ordersTrackingData.length) {
56+
if (config.ordersTrackingData.hasOwnProperty('currency')) {
5757
ga('require', 'ec', 'ec.js');
5858

5959
//Set currency code

app/code/Magento/Search/view/frontend/web/form-mini.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ define([
5555
this.autoComplete = $(this.options.destinationSelector);
5656
this.searchForm = $(this.options.formSelector);
5757
this.submitBtn = this.searchForm.find(this.options.submitBtn)[0];
58-
this.searchLabel = $(this.options.searchLabel);
58+
this.searchLabel = this.searchForm.find(this.options.searchLabel);
5959
this.isExpandable = this.options.isExpandable;
6060

6161
_.bindAll(this, '_onKeyDown', '_onPropertyChange', '_onSubmit');

app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,8 @@ define([
722722
* @param {Number} page - current page
723723
*/
724724
changePage: function (page) {
725+
this.clear();
726+
725727
if (page === 1 && !this.recordData().length) {
726728
return false;
727729
}
@@ -763,15 +765,13 @@ define([
763765
* Change page to next
764766
*/
765767
nextPage: function () {
766-
this.clear();
767768
this.currentPage(this.currentPage() + 1);
768769
},
769770

770771
/**
771772
* Change page to previous
772773
*/
773774
previousPage: function () {
774-
this.clear();
775775
this.currentPage(this.currentPage() - 1);
776776
},
777777

0 commit comments

Comments
 (0)