Skip to content

Commit d7cad14

Browse files
committed
v3.11.0 release
1 parent 34b5b61 commit d7cad14

File tree

8 files changed

+317
-207
lines changed

8 files changed

+317
-207
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
## CHANGELOG
22

3+
### Version 3.11.0
4+
5+
+ **option.position** extended with parameters **minLeft**, **maxLeft**, **minTop** and **maxTop**
6+
+ **bugfix** in options **dragit** and **resizeit** when panel content includes one or more iframes
7+
+ various minor bugfixes
8+
39
### Version 3.10.0
410

511
+ **Added** options **dragit** and **resizeit** callbacks start, drag/resize and stop receive second argument with position/size object

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
[![Build Status](https://travis-ci.org/Flyer53/jsPanel3.svg?branch=master)](https://travis-ci.org/Flyer53/jsPanel3) [![CDNJS](https://img.shields.io/cdnjs/v/jspanel3.svg)](https://cdnjs.com/libraries/jspanel3) ![license MIT](https://img.shields.io/badge/license-MIT-blue.svg) [![npm version](https://badge.fury.io/js/jspanel3.svg)](https://badge.fury.io/js/jspanel3) [![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/jsPanel/Lobby?utm_source=share-link&utm_medium=link&utm_campaign=share-link)
1+
[![Build Status](https://travis-ci.org/Flyer53/jsPanel3.svg?branch=master)](https://travis-ci.org/Flyer53/jsPanel3) [![CDNJS](https://img.shields.io/cdnjs/v/jspanel3.svg)](https://cdnjs.com/libraries/jspanel3) ![license MIT](https://img.shields.io/badge/license-MIT-blue.svg) [![npm version](https://badge.fury.io/js/jspanel3.svg)](https://badge.fury.io/js/jspanel3) [![npm](https://img.shields.io/npm/dt/express.svg)](https://www.npmjs.com/package/jspanel3) [![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/jsPanel/Lobby?utm_source=share-link&utm_medium=link&utm_campaign=share-link)
22

3-
## [jsPanel 3.10.0 released 2017-08-19](#)
3+
## [jsPanel 3.11.0 released 2017-10-22](#)
44

55

66
**A jQuery plugin to create highly configurable multifunctional floating panels.**
@@ -11,7 +11,7 @@
1111

1212
**News:**
1313

14-
+ I'm working on a **jsPanel** version that does **without dependencies (not even jQuery)**. For now it's strictly experimental and works with FF, Chrome, Edge, Brave, Opera and IE10/11. Interested? A simple demo page is [here](http://alpha.jspanel.de/)
14+
+ I'm working on **jsPanel version 4** that does **without dependencies (not even jQuery)**. It's close to beta stage and works with FF, Chrome, Edge, Brave, Opera and Vivaldi. Interested? A demo site is **[here](http://alpha.jspanel.de/)**
1515
+ Want to **stay up to date** about new jsPanel releases, bugfixes, plans and other jsPanel related topics? Then sign up for the **[monthly newsletter](http://jspanel.de/api/#mailinglist)**
1616

1717
---

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jspanel3",
3-
"version": "v3.10.0",
3+
"version": "v3.11.0",
44
"description": "A jQuery Plugin to create highly configurable multifunctional floating panels for use in backend solutions and other web applications. Also usable as modal panel, tooltip or hint. With built in support for bootstrap, right-to-left text direction and more ...",
55
"keywords": [
66
"jQuery",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jspanel3",
3-
"version": "3.10.0",
3+
"version": "3.11.0",
44
"description": "A jQuery Plugin to create highly configurable multifunctional floating panels",
55
"dependencies": {
66
"jquery": ">=2.x"

source/jquery.jspanel-compiled.js

Lines changed: 59 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ if (!Object.assign) {
3737
}
3838

3939
var jsPanel = {
40-
version: '3.10.0',
41-
date: '2017-08-19 12:37',
40+
version: '3.11.0',
41+
date: '2017-10-20 21:25',
4242
id: 0, // counter to add to automatically generated id attribute
4343
ziBase: 100, // the lowest z-index a jsPanel may have
4444
zi: 100, // z-index counter, has initially to be the same as ziBase
@@ -982,7 +982,8 @@ var jsPanel = {
982982
drag = void 0,
983983
dragstop = void 0,
984984
left = void 0,
985-
top = void 0;
985+
top = void 0,
986+
frames = [];
986987

987988
if (jsPanel.isIE) {
988989
// old fashioned only for IE11
@@ -1039,6 +1040,13 @@ var jsPanel = {
10391040
handles[_i].addEventListener(jsPanel.evtStart, function (e) {
10401041
e.preventDefault();
10411042

1043+
frames = Array.prototype.slice.call(document.querySelectorAll('iframe'));
1044+
if (frames.length) {
1045+
frames.forEach(function (item) {
1046+
item.style.pointerEvents = 'none';
1047+
});
1048+
}
1049+
10421050
var elmtRect = elmt.getBoundingClientRect(),
10431051
/* needs to be calculated on pointerdown!! */
10441052
elmtParentRect = elmtParent.getBoundingClientRect(),
@@ -1051,8 +1059,11 @@ var jsPanel = {
10511059
elmtParentBottomBorder = parseInt(elmtParentStyles.getPropertyValue('border-bottom-width'), 10),
10521060
startLeft = void 0,
10531061
startTop = void 0,
1054-
startX = e.pageX || e.touches[0].pageX,
1055-
startY = e.pageY || e.touches[0].pageY,
1062+
1063+
//startX = e.pageX || e.touches[0].pageX,
1064+
//startY = e.pageY || e.touches[0].pageY,
1065+
startX = e.touches ? e.touches[0].pageX : e.pageX,
1066+
startY = e.touches ? e.touches[0].pageY : e.pageY,
10561067
scrollLeft = window.scrollX || window.pageXOffset,
10571068
// IE11 doesn't know scrollX
10581069
scrollTop = window.scrollY || window.pageYOffset,
@@ -1151,8 +1162,10 @@ var jsPanel = {
11511162
// trigger drag permanently while draging
11521163
document.dispatchEvent(drag);
11531164

1154-
left = elmtParentLeftBorder + startLeft + (evt.pageX || evt.touches[0].pageX) - startX + xDif;
1155-
top = elmtParentTopBorder + startTop + (evt.pageY || evt.touches[0].pageY) - startY + yDif;
1165+
//left = elmtParentLeftBorder + startLeft + (evt.pageX || evt.touches[0].pageX) - startX + xDif;
1166+
//top = elmtParentTopBorder + startTop + (evt.pageY || evt.touches[0].pageY) - startY + yDif;
1167+
left = elmtParentLeftBorder + startLeft + (evt.touches ? evt.touches[0].pageX : evt.pageX) - startX + xDif;
1168+
top = elmtParentTopBorder + startTop + (evt.touches ? evt.touches[0].pageY : evt.pageY) - startY + yDif;
11561169

11571170
// apply min/max left/top values if needed
11581171
if (left <= minLeft) {
@@ -1221,6 +1234,11 @@ var jsPanel = {
12211234
opts.stop.call(el, el, { left: parseFloat(el.css('left')), top: parseFloat(el.css('top')) });
12221235
}
12231236
}
1237+
if (frames.length) {
1238+
frames.forEach(function (item) {
1239+
item.style.pointerEvents = 'inherit';
1240+
});
1241+
}
12241242
}, false);
12251243

12261244
return el;
@@ -1262,7 +1280,8 @@ var jsPanel = {
12621280
minHeight = typeof opts.minHeight === 'function' ? opts.minHeight() : opts.minHeight,
12631281
resizestart = void 0,
12641282
resize = void 0,
1265-
resizestop = void 0;
1283+
resizestop = void 0,
1284+
frames = [];
12661285
if (jsPanel.isIE) {
12671286
// old fashioned only for IE11
12681287
resizestart = document.createEvent('CustomEvent');
@@ -1315,6 +1334,13 @@ var jsPanel = {
13151334
handles[i].addEventListener(jsPanel.evtStart, function (e) {
13161335
e.preventDefault();
13171336

1337+
frames = Array.prototype.slice.call(document.querySelectorAll('iframe'));
1338+
if (frames.length) {
1339+
frames.forEach(function (item) {
1340+
item.style.pointerEvents = 'none';
1341+
});
1342+
}
1343+
13181344
var elmtRect = elmt.getBoundingClientRect(),
13191345
/* needs to be calculated on pointerdown!! */
13201346
elmtParentRect = elmtParent.getBoundingClientRect(),
@@ -1656,6 +1682,11 @@ var jsPanel = {
16561682
opts.stop.call(el, el, { width: parseFloat(el.css('width')), height: parseFloat(el.css('height')) });
16571683
}
16581684
}
1685+
if (frames.length) {
1686+
frames.forEach(function (item) {
1687+
item.style.pointerEvents = 'inherit';
1688+
});
1689+
}
16591690
}, false);
16601691

16611692
return el;
@@ -2673,6 +2704,20 @@ var jsPanel = {
26732704

26742705
newCoords = { left: newCoordsLeft, top: newCoordsTop };
26752706

2707+
// apply minLeft, minTop, maxLeft and maxTop values (need to be numbers)
2708+
if ((option.minLeft || option.minLeft === 0) && typeof option.minLeft === 'number' && newCoords.left < option.minLeft) {
2709+
newCoords.left = option.minLeft;
2710+
}
2711+
if ((option.maxLeft || option.maxLeft === 0) && typeof option.maxLeft === 'number' && newCoords.left > option.maxLeft) {
2712+
newCoords.left = option.maxLeft;
2713+
}
2714+
if ((option.minTop || option.minTop === 0) && typeof option.minTop === 'number' && newCoords.top < option.minTop) {
2715+
newCoords.top = option.minTop;
2716+
}
2717+
if ((option.maxTop || option.maxTop === 0) && typeof option.maxTop === 'number' && newCoords.top > option.maxTop) {
2718+
newCoords.top = option.maxTop;
2719+
}
2720+
26762721
if (typeof option.modify === 'function') {
26772722

26782723
newCoords = option.modify.call(newCoords, newCoords);
@@ -3334,10 +3379,14 @@ if ('ontouchend' in window) {
33343379
jsP.hideControls = function (sel) {
33353380
// NodeList.forEach() is not supported by all browsers yet -> convert to array
33363381
Array.prototype.slice.call(jsP.header.controls[0].getElementsByClassName('jsPanel-btn')).forEach(function (item) {
3337-
item.style.display = 'block';
3382+
if (item) {
3383+
item.style.display = 'block';
3384+
}
33383385
});
33393386
sel.forEach(function (item) {
3340-
jsP.header.controls[0].querySelector(item).style.display = 'none';
3387+
if (jsP.header.controls[0].querySelector(item)) {
3388+
jsP.header.controls[0].querySelector(item).style.display = 'none';
3389+
}
33413390
});
33423391
}; /* used only internally */
33433392

0 commit comments

Comments
 (0)