Skip to content

Commit

Permalink
Merge pull request #95 from Mikk3lRo/fix-missing-closebutton
Browse files Browse the repository at this point in the history
Fix missing close button when closeButton = true and title present
  • Loading branch information
StephanWagner authored Oct 13, 2017
2 parents 6736870 + 2e7f363 commit d3bc648
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/jBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@
this.closeButton = jQuery('<div class="jBox-closeButton jBox-noDrag"/>').on('touchend click', function (ev) { this.close({ignoreDelay: true}); }.bind(this)).append(closeButtonSVG);

// Add close button to jBox container
if (this.options.closeButton == 'box' || (this.options.closeButton === true && !this.options.overlay && !this.options.title)) {
if (this.options.closeButton == 'box' || (this.options.closeButton === true && !this.options.overlay && !this.options.title && !this.options.getTitle)) {
this.wrapper.addClass('jBox-closeButton-box');
this.closeButton.appendTo(this.container);
}
Expand Down Expand Up @@ -562,7 +562,7 @@
}).appendTo(this.options.appendTo);

// Add close button to overlay
(this.options.closeButton == 'overlay' || (this.options.closeButton === true && !this.titleContainer)) && this.overlay.append(this.closeButton);
(this.options.closeButton == 'overlay' || this.options.closeButton === true) && this.overlay.append(this.closeButton);

// Add closeOnClick: 'overlay' events
this.options.closeOnClick == 'overlay' && this.overlay.on('touchend click', function () { this.close({ignoreDelay: true}); }.bind(this));
Expand Down

0 comments on commit d3bc648

Please sign in to comment.