Skip to content
This repository was archived by the owner on Jan 29, 2026. It is now read-only.

Commit 6b94d95

Browse files
committed
bugfix option.position
This version fixes a bug when using option.position with a setting of {top: 'auto', left: 'auto'}
1 parent ecf0556 commit 6b94d95

File tree

7 files changed

+74
-82
lines changed

7 files changed

+74
-82
lines changed

CHANGELOG.md

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

3+
### Version 2.5.4
4+
5+
+ bugfix **option.position** when using **{ top: 'auto', left: 'auto' }**
6+
37
---
48

59
### Version 2.5.3

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## [jsPanel 2.5.3 released 2015-07-21](#)
1+
## [jsPanel 2.5.4 released 2015-09-28](#)
22

33
**A jQuery plugin to create multifunctional floating panels.**
44

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jspanel",
3-
"version": "v2.5.3",
3+
"version": "v2.5.4",
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",

jsPanel.jquery.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"hint",
1616
"bootstrap"
1717
],
18-
"version": "2.5.3",
18+
"version": "2.5.4",
1919
"author": {
2020
"name": "Stefan Straesser",
2121
"url": "http://jspanel.de/",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jspanel",
3-
"version": "2.5.3",
3+
"version": "2.5.4",
44
"description": "A jQuery Plugin to create highly configurable floating panels for use in a backend solution and other web applications",
55
"main": [
66
"source/jquery.jspanel.js",

source/jquery.jspanel.js

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,9 @@
2626
THE SOFTWARE.
2727
2828
<http://opensource.org/licenses/MIT>.
29-
*/
3029
31-
/*
32-
CHANGES IN 2.5.3:
33-
+ toolbars now get the same font-family as the title (changes in .addToolbar(), option.toolbarHeader and option.toolbarFooter)
34-
+ css/styling for hints changed
35-
+ jsPanel.hideControls() modified
36-
+ almost all 'px' removed
37-
+ option.load: inside the complete callback 'this' refers to the content property of the panel
38-
+ option.ajax: inside the callback functions 'this' refers to the content property of the panel
39-
+ option.ajax: new parameter 'autoload' (if set to 'false' returned data is NOT appended to content section by default)
40-
+ option.callback: inside the callback functions 'this' refers to the jsPanel
41-
+ setting size simplified internally and jsPanel.setSize() removed
42-
+ Tooltips don't have a drag cursor anymore
30+
CHANGES IN 2.5.4:
31+
+ option.position bugfix when using { left: 'auto', top: 'auto' }
4332
*/
4433

4534
"use strict";
@@ -53,7 +42,7 @@ if (!$.fn.jquery || !$.fn.uniqueId || !$.widget || !$.ui.mouse || !$.ui.draggabl
5342
}
5443

5544
var jsPanel = {
56-
version: '2.5.3 2015-07-20 07:37',
45+
version: '2.5.4 2015-09-28 10:05',
5746
device: (function(){
5847
try {
5948
// requires "mobile-detect.js" to be loaded
@@ -192,7 +181,7 @@ var jsPanel = {
192181
if (jsP.option.position.top === 'center') {
193182
jsP.option.position.top = this.calcPosCenter(jsP.option).top;
194183
} else {
195-
this.calcPos('top', jsP);
184+
panelpos.top = this.calcPos('top', jsP); // change in 2.5.4
196185
}
197186
}
198187
// calculate left | right values != center
@@ -202,7 +191,7 @@ var jsPanel = {
202191
if (jsP.option.position.left === 'center') {
203192
jsP.option.position.left = this.calcPosCenter(jsP.option).left;
204193
} else {
205-
this.calcPos('left', jsP);
194+
panelpos.left = this.calcPos('left', jsP); // change in 2.5.4
206195
}
207196
}
208197
if (jsP.option.position.top) {
@@ -753,8 +742,7 @@ var jsPanel = {
753742
// loads content using jQuery.load()
754743
load: function(panel) {
755744
panel.content.load(panel.option.load.url, panel.option.load.data || undefined, function (responseText, textStatus, jqXHR) {
756-
if (panel.option.load.complete) {
757-
//panel.option.load.complete(responseText, textStatus, jqXHR, panel);
745+
if ($.isFunction(panel.option.load.complete)) {
758746
panel.option.load.complete.call(panel.content, responseText, textStatus, jqXHR, panel);
759747
}
760748
// title h3 might be to small: load() is async!
@@ -1900,9 +1888,9 @@ console.log("jsPanel version: " + jsPanel.version);
19001888
jsP.css({
19011889
display: 'block',
19021890
opacity: 1
1903-
})
1904-
.trigger('jspanelloaded', jsP.attr('id'))
1905-
.trigger('jspanelstatechange', jsP.attr('id'));
1891+
});
1892+
$(jsP).trigger('jspanelloaded', jsP.attr('id'))
1893+
$(jsP).trigger('jspanelstatechange', jsP.attr('id'));
19061894
jsP.option.size = {
19071895
width: jsP.outerWidth(),
19081896
height: jsP.outerHeight()
@@ -1925,10 +1913,10 @@ console.log("jsPanel version: " + jsPanel.version);
19251913
jsP.css({
19261914
display: 'block',
19271915
opacity: 1
1928-
})
1929-
.addClass(jsP.option.show)
1930-
.trigger('jspanelloaded', jsP.attr('id'))
1931-
.trigger('jspanelstatechange', jsP.attr('id'));
1916+
});
1917+
$(jsP).addClass(jsP.option.show)
1918+
$(jsP) .trigger('jspanelloaded', jsP.attr('id'))
1919+
$(jsP).trigger('jspanelstatechange', jsP.attr('id'));
19321920
jsP.option.size = {
19331921
width: jsP.outerWidth(),
19341922
height: jsP.outerHeight()

0 commit comments

Comments
 (0)