diff --git a/CHANGELOG.md b/CHANGELOG.md
index c98a3c4..16ebf2b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,10 @@
## CHANGELOG
+### Version 4.16.1 *2022-11-03*
+
++ simplified internal code to process theme options and removed some obsolete code
++ fix in css file to prevent overflowing title in minimized panel replacement
+
### Version 4.16.0 *2022-07-03*
+ **added** Dialog extension. This extension adds an easy-to-use interface for dialog elements to virtually any jsPanel. It also offers a `modal()` function to create modal dialogs as well as `alert()`, `confirm()` and `prompt()` functions. `jsPanel.dialog` is a Third Party Extension developed and maintained by Michael Daumling.
diff --git a/README.md b/README.md
index 8da3d3b..233450b 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
-## [jsPanel 4.16.0 released 2022-07-03](#)
+## [jsPanel 4.16.1 released 2022-11-03](#)
> As of v4.11.0-beta methods `jsPanel.ajax()` and `jsPanel.fetch()` are updated. That also affects options `contentAjax` and `contentFetch`. These updates might break existing code. So please check the docs on https://jspanel.de/
diff --git a/dist/extensions/contextmenu/jspanel.contextmenu.js b/dist/extensions/contextmenu/jspanel.contextmenu.js
index 271d655..91c4d36 100644
--- a/dist/extensions/contextmenu/jspanel.contextmenu.js
+++ b/dist/extensions/contextmenu/jspanel.contextmenu.js
@@ -1,6 +1,6 @@
/**
* jsPanel - A JavaScript library to create highly configurable multifunctional floating panels that can also be used as modal, tooltip, hint or contextmenu
- * @version v4.16.0
+ * @version v4.16.1
* @homepage https://jspanel.de/
* @license MIT
* @author Stefan Sträßer - info@jspanel.de
@@ -24,51 +24,43 @@ if (!jsPanel.contextmenu) {
},
cmOverflow: function cmOverflow(elmt) {
var cltX = elmt.cmEvent.clientX,
- cltY = elmt.cmEvent.clientY,
- panelW = elmt.offsetWidth,
- panelH = elmt.offsetHeight,
- corrLeft = window.innerWidth - (cltX + panelW),
- corrTop = window.innerHeight - (cltY + panelH);
-
+ cltY = elmt.cmEvent.clientY,
+ panelW = elmt.offsetWidth,
+ panelH = elmt.offsetHeight,
+ corrLeft = window.innerWidth - (cltX + panelW),
+ corrTop = window.innerHeight - (cltY + panelH);
if (corrLeft < 0) {
elmt.style.left = cltX + (window.scrollX || window.pageXOffset) - panelW + 'px';
}
-
if (corrTop < 0) {
elmt.style.top = cltY + (window.scrollY || window.pageYOffset) - panelH + 'px';
}
},
create: function create() {
var _this = this;
-
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var evt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'contextmenu';
options.paneltype = 'contextmenu';
var target = options.target;
-
if (!target) {
return false;
}
-
if (typeof target === 'string') {
target = document.querySelector(target);
}
-
target.addEventListener(evt, function (e) {
- e.preventDefault(); // close all contextmenus first
-
+ e.preventDefault();
+ // close all contextmenus first
document.querySelectorAll('.jsPanel-contextmenu').forEach(function (item) {
item.close();
});
var l = (e.pageX || e.touches[0].pageX) + 'px',
- t = (e.pageY || e.touches[0].pageY) + 'px',
- opts = options;
-
+ t = (e.pageY || e.touches[0].pageY) + 'px',
+ opts = options;
if (options.config) {
opts = Object.assign({}, options.config, options);
delete opts.config;
}
-
opts = Object.assign({}, _this.defaults, opts, {
position: false,
container: 'body'
@@ -78,34 +70,31 @@ if (!jsPanel.contextmenu) {
position: 'absolute',
left: l,
top: t
- }); // check whether contextmenu is triggered from within a modal panel or panel and if so update z-index
+ });
+ // check whether contextmenu is triggered from within a modal panel or panel and if so update z-index
var closestModal = target.closest('.jsPanel-modal');
-
if (closestModal) {
cm.style.zIndex = closestModal.style.zIndex;
} else {
var closestPanel = target.closest('.jsPanel');
-
if (closestPanel) {
closestPanel.front();
}
-
cm.style.zIndex = jsPanel.zi.next();
- } // save event object as property of cm outer div (needed in checkContextmenuOverflow())
-
+ }
- cm.cmEvent = e; // update left/top values if menu overflows browser viewport
+ // save event object as property of cm outer div (needed in checkContextmenuOverflow())
+ cm.cmEvent = e;
+ // update left/top values if menu overflows browser viewport
jsPanel.contextmenu.cmOverflow(cm);
-
if (opts.closeOnMouseleave) {
cm.addEventListener('mouseleave', function () {
cm.close();
}, false);
- } // don't close contextmenu on mousedown in contextmenu
-
-
+ }
+ // don't close contextmenu on mousedown in contextmenu
jsPanel.pointerdown.forEach(function (evt) {
cm.addEventListener(evt, function (e) {
e.stopPropagation();
@@ -114,14 +103,16 @@ if (!jsPanel.contextmenu) {
});
}, false);
}
- }; // add overflow check to jsPanel.contentAjax always callback
+ };
+ // add overflow check to jsPanel.contentAjax always callback
jsPanel.ajaxAlwaysCallbacks.push(function (xhr, obj) {
if (obj && obj.classList && obj.classList.contains('jsPanel-contextmenu')) {
jsPanel.contextmenu.cmOverflow(obj);
}
- }); // close tooltips on pointerdown in document
+ });
+ // close tooltips on pointerdown in document
jsPanel.pointerdown.forEach(function (evt) {
document.addEventListener(evt, function (e) {
document.querySelectorAll('.jsPanel-contextmenu').forEach(function (item) {
diff --git a/dist/extensions/datepicker/jspanel.datepicker.js b/dist/extensions/datepicker/jspanel.datepicker.js
index bc99826..1d216ad 100644
--- a/dist/extensions/datepicker/jspanel.datepicker.js
+++ b/dist/extensions/datepicker/jspanel.datepicker.js
@@ -1,6 +1,6 @@
/**
* jsPanel - A JavaScript library to create highly configurable multifunctional floating panels that can also be used as modal, tooltip, hint or contextmenu
- * @version v4.16.0
+ * @version v4.16.1
* @homepage https://jspanel.de/
* @license MIT
* @author Stefan Sträßer - info@jspanel.de
@@ -10,18 +10,17 @@
'use strict';
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
-
/**
* requires moment.js < https://momentjs.com/ > to be loaded prior this extension
*/
+
// TODO: - cancelable events dateselect, rangeselect, selectionclear, etc. ??
// - alternative way to select a range, e.g start by Alt+Click end end by another Alt-Click ??
// - make dates not selectable and mark them accordingly ??
// - load list of days to highlight somehow (e.g. holidays)
+
if (!jsPanel.datepicker) {
// add some icons for the datepicker controls
jsPanel.icons.chevronLeft = "";
@@ -46,13 +45,12 @@ if (!jsPanel.datepicker) {
var wrapper = document.createElement('div');
wrapper.className = 'jsPanel-cal-wrapper';
wrapper.innerHTML = "
'.concat(e,"
")})},create:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;jsPanel.zi||(jsPanel.zi=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:jsPanel.ziBase;return{next:function(){return e++}}}()),t.config?delete(t=Object.assign({},this.defaults,t.config,t)).config:t=Object.assign({},this.defaults,t),t.id?"function"==typeof t.id&&(t.id=t.id()):t.id="jsPanel-".concat(jsPanel.idCounter+=1);var o=document.getElementById(t.id);if(null!==o){if(o.classList.contains("jsPanel")&&o.front(),this.errorReporting){var a="◀ COULD NOT CREATE NEW JSPANEL ►'.concat(e,"
")})},create:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;jsPanel.zi||(jsPanel.zi=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:jsPanel.ziBase;return{next:function(){return e++}}}()),t.config?delete(t=Object.assign({},this.defaults,t.config,t)).config:t=Object.assign({},this.defaults,t),t.id?"function"==typeof t.id&&(t.id=t.id()):t.id="jsPanel-".concat(jsPanel.idCounter+=1);var o=document.getElementById(t.id);if(null!==o){if(o.classList.contains("jsPanel")&&o.front(),this.errorReporting){var a="◀ COULD NOT CREATE NEW JSPANEL ►${e}
`})},create(e={},t){jsPanel.zi||(jsPanel.zi=((e=jsPanel.ziBase)=>{let t=e;return{next:()=>t++}})()),e.config?delete(e=Object.assign({},this.defaults,e.config,e)).config:e=Object.assign({},this.defaults,e),e.id?"function"==typeof e.id&&(e.id=e.id()):e.id=`jsPanel-${jsPanel.idCounter+=1}`;const o=document.getElementById(e.id);if(null!==o){if(o.classList.contains("jsPanel")&&o.front(),this.errorReporting){let t=`◀ COULD NOT CREATE NEW JSPANEL ►${e}
`})},create(e={},t){jsPanel.zi||(jsPanel.zi=((e=jsPanel.ziBase)=>{let t=e;return{next:()=>t++}})()),e.config?delete(e=Object.assign({},this.defaults,e.config,e)).config:e=Object.assign({},this.defaults,e),e.id?"function"==typeof e.id&&(e.id=e.id()):e.id=`jsPanel-${jsPanel.idCounter+=1}`;const n=document.getElementById(e.id);if(null!==n){if(n.classList.contains("jsPanel")&&n.front(),this.errorReporting){let t=`◀ COULD NOT CREATE NEW JSPANEL ►