Skip to content

Commit 13accaa

Browse files
committed
MC-5423: Scheduled Update slide out issues
- Resolve PR comments - Resolve TS linting issues
1 parent ca6ac18 commit 13accaa

File tree

7 files changed

+39
-36
lines changed

7 files changed

+39
-36
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/js/page-builder.js

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/js/panel.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/js/utils/position-sticky.js

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/drag-drop/sortable.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ function onSortStart(preview: Preview, event: Event, ui: JQueryUI.SortableUIPara
129129
"option", "connectWith",
130130
getAllowedContainersClasses(
131131
contentTypeInstance.config.name,
132-
preview.parent.stageId
133-
)
132+
preview.parent.stageId,
133+
),
134134
);
135135
$(this).sortable("refresh");
136136
}

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/page-builder.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
* See COPYING.txt for license details.
44
*/
55

6-
import _ from "underscore";
76
import $ from "jquery";
87
import ko from "knockout";
98
import events from "Magento_PageBuilder/js/events";
109
import utils from "mageUtils";
10+
import _ from "underscore";
1111
import Config from "./config";
1212
import PageBuilderInterface from "./page-builder.d";
1313
import Panel from "./panel";
@@ -52,7 +52,7 @@ export default class PageBuilder implements PageBuilderInterface {
5252
* @param {StageToggleFullScreenParamsInterface} args
5353
*/
5454
public toggleFullScreen(args: StageToggleFullScreenParamsInterface): void {
55-
if (typeof args.animate !== "undefined" && args.animate === false) {
55+
if (args.animate === false) {
5656
this.isFullScreen(!this.isFullScreen());
5757
return;
5858
}
@@ -72,11 +72,11 @@ export default class PageBuilder implements PageBuilderInterface {
7272
parseInt($(window).scrollTop().toString(), 10);
7373
const yPosition = stageWrapper.offset().left;
7474
this.previousWrapperStyles = {
75-
'position': 'fixed',
76-
'top': `${xPosition}px`,
77-
'left': `${yPosition}px`,
78-
'zIndex': '800',
79-
'width': stageWrapper.outerWidth().toString() + 'px'
75+
position: "fixed",
76+
top: `${xPosition}px`,
77+
left: `${yPosition}px`,
78+
zIndex: "800",
79+
width: stageWrapper.outerWidth().toString() + "px",
8080
};
8181
this.wrapperStyles(this.previousWrapperStyles);
8282
this.isFullScreen(true);
@@ -86,7 +86,7 @@ export default class PageBuilder implements PageBuilderInterface {
8686
this.wrapperStyles(Object.keys(this.previousWrapperStyles)
8787
.reduce((object: object, styleName: string) => {
8888
return Object.assign(object, {[styleName]: ""});
89-
}, {})
89+
}, {}),
9090
);
9191
});
9292
} else {
@@ -101,7 +101,7 @@ export default class PageBuilder implements PageBuilderInterface {
101101
this.wrapperStyles(Object.keys(this.previousWrapperStyles)
102102
.reduce((object: object, styleName: string) => {
103103
return Object.assign(object, {[styleName]: ""});
104-
}, {})
104+
}, {}),
105105
);
106106
this.previousWrapperStyles = {};
107107
this.previousPanelHeight = null;

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/panel.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export default class Panel implements PanelInterface {
177177
*/
178178
public getDraggableOptions(element: HTMLElement): JQueryUI.DraggableOptions {
179179
// If we're within a modal make the containment be the current modal
180-
let containment: string | JQuery = "document";
180+
let containment: JQuery;
181181
if ($(element).parents(".modal-inner-wrap").length > 0) {
182182
containment = $(element).parents(".modal-inner-wrap");
183183
}
@@ -187,7 +187,7 @@ export default class Panel implements PanelInterface {
187187
appendTo: "body",
188188
cursor: "-webkit-grabbing",
189189
connectToSortable: ".content-type-drop",
190-
containment,
190+
containment: containment || "document",
191191
scroll: true,
192192
helper() {
193193
return $(this).clone().css({
@@ -251,11 +251,11 @@ export default class Panel implements PanelInterface {
251251
return new GroupContentType(
252252
identifier,
253253
contentType,
254-
this.parent.stage.id
254+
this.parent.stage.id,
255255
);
256256
},
257257
),
258-
this.parent.stage.id
258+
this.parent.stage.id,
259259
));
260260
});
261261

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/utils/position-sticky.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@ export function supportsPositionSticky() {
1313
return false;
1414
}
1515

16-
const testNode = document.createElement('div');
16+
const testNode = document.createElement("div");
1717

18-
return ['', '-webkit-', '-moz-', '-ms-'].some(prefix => {
18+
return ["", "-webkit-", "-moz-", "-ms-"].some((prefix) => {
1919
try {
20-
testNode.style.position = prefix + 'sticky';
20+
testNode.style.position = prefix + "sticky";
21+
}
22+
catch (e) {
23+
// Fail silently
2124
}
22-
catch(e) {}
2325

24-
return testNode.style.position != '';
25-
})
26-
}
26+
return testNode.style.position !== "";
27+
});
28+
}

0 commit comments

Comments
 (0)