Skip to content

Commit

Permalink
bugfix option.position
Browse files Browse the repository at this point in the history
This version fixes a bug when using option.position with a setting of
{top: 'auto', left: 'auto'}
  • Loading branch information
Flyer53 committed Sep 28, 2015
1 parent ecf0556 commit 6b94d95
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 82 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## CHANGELOG

### Version 2.5.4

+ bugfix **option.position** when using **{ top: 'auto', left: 'auto' }**

---

### Version 2.5.3
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## [jsPanel 2.5.3 released 2015-07-21](#)
## [jsPanel 2.5.4 released 2015-09-28](#)

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

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jspanel",
"version": "v2.5.3",
"version": "v2.5.4",
"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 ...",
"keywords": [
"jQuery",
Expand Down
2 changes: 1 addition & 1 deletion jsPanel.jquery.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"hint",
"bootstrap"
],
"version": "2.5.3",
"version": "2.5.4",
"author": {
"name": "Stefan Straesser",
"url": "http://jspanel.de/",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jspanel",
"version": "2.5.3",
"version": "2.5.4",
"description": "A jQuery Plugin to create highly configurable floating panels for use in a backend solution and other web applications",
"main": [
"source/jquery.jspanel.js",
Expand Down
38 changes: 13 additions & 25 deletions source/jquery.jspanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,9 @@
THE SOFTWARE.
<http://opensource.org/licenses/MIT>.
*/
/*
CHANGES IN 2.5.3:
+ toolbars now get the same font-family as the title (changes in .addToolbar(), option.toolbarHeader and option.toolbarFooter)
+ css/styling for hints changed
+ jsPanel.hideControls() modified
+ almost all 'px' removed
+ option.load: inside the complete callback 'this' refers to the content property of the panel
+ option.ajax: inside the callback functions 'this' refers to the content property of the panel
+ option.ajax: new parameter 'autoload' (if set to 'false' returned data is NOT appended to content section by default)
+ option.callback: inside the callback functions 'this' refers to the jsPanel
+ setting size simplified internally and jsPanel.setSize() removed
+ Tooltips don't have a drag cursor anymore
CHANGES IN 2.5.4:
+ option.position bugfix when using { left: 'auto', top: 'auto' }
*/

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

var jsPanel = {
version: '2.5.3 2015-07-20 07:37',
version: '2.5.4 2015-09-28 10:05',
device: (function(){
try {
// requires "mobile-detect.js" to be loaded
Expand Down Expand Up @@ -192,7 +181,7 @@ var jsPanel = {
if (jsP.option.position.top === 'center') {
jsP.option.position.top = this.calcPosCenter(jsP.option).top;
} else {
this.calcPos('top', jsP);
panelpos.top = this.calcPos('top', jsP); // change in 2.5.4
}
}
// calculate left | right values != center
Expand All @@ -202,7 +191,7 @@ var jsPanel = {
if (jsP.option.position.left === 'center') {
jsP.option.position.left = this.calcPosCenter(jsP.option).left;
} else {
this.calcPos('left', jsP);
panelpos.left = this.calcPos('left', jsP); // change in 2.5.4
}
}
if (jsP.option.position.top) {
Expand Down Expand Up @@ -753,8 +742,7 @@ var jsPanel = {
// loads content using jQuery.load()
load: function(panel) {
panel.content.load(panel.option.load.url, panel.option.load.data || undefined, function (responseText, textStatus, jqXHR) {
if (panel.option.load.complete) {
//panel.option.load.complete(responseText, textStatus, jqXHR, panel);
if ($.isFunction(panel.option.load.complete)) {
panel.option.load.complete.call(panel.content, responseText, textStatus, jqXHR, panel);
}
// title h3 might be to small: load() is async!
Expand Down Expand Up @@ -1900,9 +1888,9 @@ console.log("jsPanel version: " + jsPanel.version);
jsP.css({
display: 'block',
opacity: 1
})
.trigger('jspanelloaded', jsP.attr('id'))
.trigger('jspanelstatechange', jsP.attr('id'));
});
$(jsP).trigger('jspanelloaded', jsP.attr('id'))
$(jsP).trigger('jspanelstatechange', jsP.attr('id'));
jsP.option.size = {
width: jsP.outerWidth(),
height: jsP.outerHeight()
Expand All @@ -1925,10 +1913,10 @@ console.log("jsPanel version: " + jsPanel.version);
jsP.css({
display: 'block',
opacity: 1
})
.addClass(jsP.option.show)
.trigger('jspanelloaded', jsP.attr('id'))
.trigger('jspanelstatechange', jsP.attr('id'));
});
$(jsP).addClass(jsP.option.show)
$(jsP) .trigger('jspanelloaded', jsP.attr('id'))
$(jsP).trigger('jspanelstatechange', jsP.attr('id'));
jsP.option.size = {
width: jsP.outerWidth(),
height: jsP.outerHeight()
Expand Down
Loading

0 comments on commit 6b94d95

Please sign in to comment.