Skip to content

Commit e338168

Browse files
committed
3.5.1 release
1 parent 88b7d3e commit e338168

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+438
-302
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@
22

33
# Change Log
44

5+
# [v3.5.1](https://github.com/framework7io/framework7/compare/v3.5.0...v3.5.1) - November 2, 2018
6+
* Core
7+
* Swiper update to latest 4.4.2:
8+
* New `touchStartForcePreventDefault` parameter to force touch start event prevent default
9+
* Breakpoints fix when breakpoint keys are strings
10+
* Fixed issue when draggable scrollbar may not work on desktop Safari
11+
* Fixed issue with wrong sort of Virtual Slides
12+
* Swipeout
13+
* Added new `swipeout:overswipeenter` and `swipeout:overswipeexit` events fired when overswipe enabled/disabled
14+
* Panel
15+
* Fixed issue when Swipe Panel could cause kind of screen flickering on open
16+
* Phenome
17+
* Messagebar - new `textareaId` property to set ID attribute on its textarea
18+
* ListItem - new `swipeoutOverswipeEnter` and `swipeoutOverswipeExit` events
19+
* Minor fixes
20+
521
# [v3.5.0](https://github.com/framework7io/framework7/compare/v3.4.3...v3.5.0) - October 26, 2018
622
* Phenome
723
* Fix issues with handling "stacked" pages

packages/core/components/dialog/dialog.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ export namespace Dialog {
4242
/** Enables bold button text. (default false) */
4343
bold?: boolean
4444
/** Button color, one of default colors. */
45-
color: string
45+
color?: string
4646
/** If enabled then button click will close Dialog. (default true) */
4747
close?: boolean
4848
/** Additional button CSS class. */
49-
cssClass: string
49+
cssClass?: string
5050
/** Array with keyboard keycodes that will be used to trigger button click. For example, key code 13 means that button click will be triggered on Enter key press. (default []) */
5151
keyCodes?: number[]
5252
/** Callback function that will be executed after click on this button. */
53-
onClick: (dialog : Dialog, e : Event) => void
53+
onClick?: (dialog : Dialog, e : Event) => void
5454
}
5555

5656
interface Parameters {

packages/core/components/modal/modal-class.js

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class Modal extends Framework7Class {
119119

120120

121121
/* eslint no-underscore-dangle: ["error", { "allow": ["_clientLeft"] }] */
122-
// modal._clientLeft = $el[0].clientLeft;
122+
modal._clientLeft = $el[0].clientLeft;
123123

124124
// Modal
125125
function transitionEnd() {
@@ -130,24 +130,22 @@ class Modal extends Framework7Class {
130130
}
131131
}
132132
if (animate) {
133-
Utils.nextFrame(() => {
134-
if ($backdropEl) {
135-
$backdropEl.removeClass('not-animated');
136-
$backdropEl.addClass('backdrop-in');
137-
}
138-
$el
139-
.animationEnd(() => {
140-
transitionEnd();
141-
});
142-
$el
143-
.transitionEnd(() => {
144-
transitionEnd();
145-
});
146-
$el
147-
.removeClass('modal-out not-animated')
148-
.addClass('modal-in');
149-
modal.onOpen();
150-
});
133+
if ($backdropEl) {
134+
$backdropEl.removeClass('not-animated');
135+
$backdropEl.addClass('backdrop-in');
136+
}
137+
$el
138+
.animationEnd(() => {
139+
transitionEnd();
140+
});
141+
$el
142+
.transitionEnd(() => {
143+
transitionEnd();
144+
});
145+
$el
146+
.removeClass('modal-out not-animated')
147+
.addClass('modal-in');
148+
modal.onOpen();
151149
} else {
152150
if ($backdropEl) {
153151
$backdropEl.addClass('backdrop-in not-animated');

packages/core/components/panel/panel-class.js

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -214,35 +214,33 @@ class Panel extends Framework7Class {
214214
$backdropEl.show();
215215

216216
/* eslint no-underscore-dangle: ["error", { "allow": ["_clientLeft"] }] */
217-
// panel._clientLeft = $el[0].clientLeft;
218-
219-
Utils.nextFrame(() => {
220-
$('html').addClass(`with-panel with-panel-${side}-${effect}`);
221-
panel.onOpen();
222-
223-
// Transition End;
224-
const transitionEndTarget = effect === 'reveal' ? $el.nextAll('.view, .views').eq(0) : $el;
225-
226-
function panelTransitionEnd() {
227-
transitionEndTarget.transitionEnd((e) => {
228-
if ($(e.target).is(transitionEndTarget)) {
229-
if ($el.hasClass('panel-active')) {
230-
panel.onOpened();
231-
$backdropEl.css({ display: '' });
232-
} else {
233-
panel.onClosed();
234-
$backdropEl.css({ display: '' });
235-
}
236-
} else panelTransitionEnd();
237-
});
238-
}
239-
if (animate) {
240-
panelTransitionEnd();
241-
} else {
242-
panel.onOpened();
243-
$backdropEl.css({ display: '' });
244-
}
245-
});
217+
panel._clientLeft = $el[0].clientLeft;
218+
219+
$('html').addClass(`with-panel with-panel-${side}-${effect}`);
220+
panel.onOpen();
221+
222+
// Transition End;
223+
const transitionEndTarget = effect === 'reveal' ? $el.nextAll('.view, .views').eq(0) : $el;
224+
225+
function panelTransitionEnd() {
226+
transitionEndTarget.transitionEnd((e) => {
227+
if ($(e.target).is(transitionEndTarget)) {
228+
if ($el.hasClass('panel-active')) {
229+
panel.onOpened();
230+
$backdropEl.css({ display: '' });
231+
} else {
232+
panel.onClosed();
233+
$backdropEl.css({ display: '' });
234+
}
235+
} else panelTransitionEnd();
236+
});
237+
}
238+
if (animate) {
239+
panelTransitionEnd();
240+
} else {
241+
panel.onOpened();
242+
$backdropEl.css({ display: '' });
243+
}
246244

247245
return true;
248246
}

packages/core/components/searchbar/searchbar-class.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,9 @@ class Searchbar extends FrameworkClass {
276276
sb.$disableButtonEl.transition(0).show();
277277
sb.$disableButtonEl.css(`margin-${app.rtl ? 'left' : 'right'}`, `${-sb.disableButtonEl.offsetWidth}px`);
278278
/* eslint no-underscore-dangle: ["error", { "allow": ["_clientLeft"] }] */
279-
// sb._clientLeft = sb.$disableButtonEl[0].clientLeft;
280-
Utils.nextFrame(() => {
281-
sb.$disableButtonEl.transition('');
282-
sb.disableButtonHasMargin = true;
283-
});
279+
sb._clientLeft = sb.$disableButtonEl[0].clientLeft;
280+
sb.$disableButtonEl.transition('');
281+
sb.disableButtonHasMargin = true;
284282
}
285283

286284
enable(setFocus) {

packages/core/components/swipeout/swipeout.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,16 @@ const Swipeout = {
165165
if ($overswipeRightButton.length > 0 && $buttonEl.hasClass('swipeout-overswipe') && direction === 'to-left') {
166166
$buttonEl.css({ left: `${overswipeRight ? -buttonOffset : 0}px` });
167167
if (overswipeRight) {
168+
if (!$buttonEl.hasClass('swipeout-overswipe-active')) {
169+
$swipeoutEl.trigger('swipeout:overswipeenter');
170+
app.emit('swipeoutOverswipeEnter', $swipeoutEl[0]);
171+
}
168172
$buttonEl.addClass('swipeout-overswipe-active');
169173
} else {
174+
if ($buttonEl.hasClass('swipeout-overswipe-active')) {
175+
$swipeoutEl.trigger('swipeout:overswipeexit');
176+
app.emit('swipeoutOverswipeExit', $swipeoutEl[0]);
177+
}
170178
$buttonEl.removeClass('swipeout-overswipe-active');
171179
}
172180
}
@@ -197,8 +205,16 @@ const Swipeout = {
197205
if ($overswipeLeftButton.length > 0 && $buttonEl.hasClass('swipeout-overswipe') && direction === 'to-right') {
198206
$buttonEl.css({ left: `${overswipeLeft ? buttonOffset : 0}px` });
199207
if (overswipeLeft) {
208+
if (!$buttonEl.hasClass('swipeout-overswipe-active')) {
209+
$swipeoutEl.trigger('swipeout:overswipeenter');
210+
app.emit('swipeoutOverswipeEnter', $swipeoutEl[0]);
211+
}
200212
$buttonEl.addClass('swipeout-overswipe-active');
201213
} else {
214+
if ($buttonEl.hasClass('swipeout-overswipe-active')) {
215+
$swipeoutEl.trigger('swipeout:overswipeexit');
216+
app.emit('swipeoutOverswipeExit', $swipeoutEl[0]);
217+
}
202218
$buttonEl.removeClass('swipeout-overswipe-active');
203219
}
204220
}

packages/core/components/swiper/swiper-class/components/core/breakpoints/setBreakpoint.js

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,30 @@ export default function () {
77
} = swiper;
88
const breakpoints = params.breakpoints;
99
if (!breakpoints || (breakpoints && Object.keys(breakpoints).length === 0)) return;
10+
1011
// Set breakpoint for window width and update parameters
1112
const breakpoint = swiper.getBreakpoint(breakpoints);
13+
1214
if (breakpoint && swiper.currentBreakpoint !== breakpoint) {
13-
const breakPointsParams = breakpoint in breakpoints ? breakpoints[breakpoint] : swiper.originalParams;
14-
const needsReLoop = params.loop && (breakPointsParams.slidesPerView !== params.slidesPerView);
15+
const breakpointOnlyParams = breakpoint in breakpoints ? breakpoints[breakpoint] : undefined;
16+
if (breakpointOnlyParams) {
17+
['slidesPerView', 'spaceBetween', 'slidesPerGroup'].forEach((param) => {
18+
const paramValue = breakpointOnlyParams[param];
19+
if (typeof paramValue === 'undefined') return;
20+
if (param === 'slidesPerView' && (paramValue === 'AUTO' || paramValue === 'auto')) {
21+
breakpointOnlyParams[param] = 'auto';
22+
} else if (param === 'slidesPerView') {
23+
breakpointOnlyParams[param] = parseFloat(paramValue);
24+
} else {
25+
breakpointOnlyParams[param] = parseInt(paramValue, 10);
26+
}
27+
});
28+
}
29+
30+
const breakpointParams = breakpointOnlyParams || swiper.originalParams;
31+
const needsReLoop = params.loop && (breakpointParams.slidesPerView !== params.slidesPerView);
1532

16-
Utils.extend(swiper.params, breakPointsParams);
33+
Utils.extend(swiper.params, breakpointParams);
1734

1835
Utils.extend(swiper, {
1936
allowTouchMove: swiper.params.allowTouchMove,
@@ -29,6 +46,6 @@ export default function () {
2946
swiper.updateSlides();
3047
swiper.slideTo((activeIndex - loopedSlides) + swiper.loopedSlides, 0, false);
3148
}
32-
swiper.emit('breakpoint', breakPointsParams);
49+
swiper.emit('breakpoint', breakpointParams);
3350
}
3451
}

packages/core/components/swiper/swiper-class/components/core/defaults.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export default {
6868
threshold: 0,
6969
touchMoveStopPropagation: true,
7070
touchStartPreventDefault: true,
71+
touchStartForcePreventDefault: false,
7172
touchReleaseOnEdges: false,
7273

7374
// Unique Navigation Elements

packages/core/components/swiper/swiper-class/components/core/events/onTouchStart.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ export default function (event) {
6565
) {
6666
document.activeElement.blur();
6767
}
68-
if (preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault) {
68+
69+
const shouldPreventDefault = preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault;
70+
if (params.touchStartForcePreventDefault || shouldPreventDefault) {
6971
e.preventDefault();
7072
}
7173
}

packages/core/components/swiper/swiper-class/components/core/update/updateSlides.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,11 @@ export default function () {
122122
} else {
123123
// eslint-disable-next-line
124124
if (swiper.isHorizontal()) {
125-
slideSize = slide[0].getBoundingClientRect().width
125+
slideSize = parseFloat(slideStyles.getPropertyValue('width'))
126126
+ parseFloat(slideStyles.getPropertyValue('margin-left'))
127127
+ parseFloat(slideStyles.getPropertyValue('margin-right'));
128128
} else {
129-
slideSize = slide[0].getBoundingClientRect().height
129+
slideSize = parseFloat(slideStyles.getPropertyValue('height'))
130130
+ parseFloat(slideStyles.getPropertyValue('margin-top'))
131131
+ parseFloat(slideStyles.getPropertyValue('margin-bottom'));
132132
}

0 commit comments

Comments
 (0)