Skip to content

Commit 1882b99

Browse files
committed
MC-35104: Tracking Page Builder content type
- Refactor: Fix JSdoc and Javascript coding standards
1 parent 12a5b5f commit 1882b99

File tree

1 file changed

+16
-9
lines changed
  • app/code/Magento/PageBuilderAdminAnalytics/view/adminhtml/web/js/page-builder

1 file changed

+16
-9
lines changed

app/code/Magento/PageBuilderAdminAnalytics/view/adminhtml/web/js/page-builder/events-mixin.js

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ define(['underscore'], function (_underscore) {
6060
/**
6161
* Sets up event attributes depending on name and args
6262
*
63-
* @param name
64-
* @param args
63+
* @param {String} name
64+
* @param {Array} args
6565
*/
6666
setupEventAttributes = function (name, args) {
6767
var arrayName = name.split(':'),
@@ -90,11 +90,17 @@ define(['underscore'], function (_underscore) {
9090
args.originalContentType.config : {};
9191
}
9292

93-
if (name.indexOf('removeAfter') !== -1) action = 'remove';
93+
if (name.indexOf('removeAfter') !== -1) {
94+
action = 'remove';
95+
}
9496

95-
if (name.indexOf('createAfter') !== -1) action = 'create';
97+
if (name.indexOf('createAfter') !== -1) {
98+
action = 'create';
99+
}
96100

97-
if (name.indexOf('renderAfter') !== -1) action = 'edit';
101+
if (name.indexOf('renderAfter') !== -1) {
102+
action = 'edit';
103+
}
98104

99105
eventAttributes =
100106
!_underscore.isUndefined(args.contentType) &&
@@ -104,10 +110,9 @@ define(['underscore'], function (_underscore) {
104110
};
105111

106112
/**
107-
* Checks if visibility has changed from previousState to state
113+
* Returns true when visibility has changed from previousState to state
108114
*
109-
* @param objectWrapper
110-
* @return {boolean} Returns true when the display attribute on previousState is different from state
115+
* @param {Object} objectWrapper
111116
*/
112117
hasVisibilityChanged = function (objectWrapper) {
113118
var state,
@@ -121,7 +126,9 @@ define(['underscore'], function (_underscore) {
121126
state = !_underscore.isUndefined(objectWrapper.dataStore.state) ?
122127
objectWrapper.dataStore.state.display : '';
123128

124-
if (previousState !== state && previousState !== '' && state !== '') return true;
129+
if (previousState !== state && previousState !== '' && state !== '') {
130+
return true;
131+
}
125132
}
126133

127134
return false;

0 commit comments

Comments
 (0)