From 0671455ae33df65eeb95a392edc8a2c6ad6c3f3c Mon Sep 17 00:00:00 2001 From: Andrew Nevins Date: Thu, 8 Oct 2015 12:24:05 +0100 Subject: [PATCH 1/5] added option to close content when clicking somewhere else on the page --- README.md | 5 ++++- index.html | 35 +++++++++++++++++++++++++++-------- jquery.hideShow.js | 21 +++++++++++++++++++++ jquery.hideShow.min.js | 2 +- jquery.hideShow.spec.js | 22 ++++++++++++++++++++++ 5 files changed, 75 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index c5176ce..dab4489 100644 --- a/README.md +++ b/README.md @@ -187,4 +187,7 @@ $ grunt --connect Copyright © 2014 [@nomensa](http://nomensa.com) -Licensed under [MIT](http://opensource.org/licenses/mit-license.php) \ No newline at end of file +Licensed under [MIT](http://opensource.org/licenses/mit-license.php) + +## Changelog +* Added ability to close content when clicking outside of that content. \ No newline at end of file diff --git a/index.html b/index.html index c52b386..31316ef 100644 --- a/index.html +++ b/index.html @@ -56,8 +56,7 @@

Example C

Contact details

-

Telephone 01234 567 890

-

Email test@test.com

+

Inserts an accessible buttons/links to hide and show sections of content.

Initialisation

@@ -71,15 +70,31 @@

Initialisation

+

Example D

+

An example that closes the content when clicking elsewhere in the document.

+

The content must have been opened up through a trigger press or click for this to work.

+
+

Closes on click elsewhere in the document.

+
+ +

Initialisation

+
+
+$(".exampleD").hideShow({
+    closeOnClick: true
+});
+
+
+

Public methods

-
+

Text content to be hidden text content to be hidden text content to be hidden text content to be hidden

-

Contact details

-
+

Contact details

+

Telephone 01234 567 890

Email test@test.com

@@ -111,10 +126,14 @@

Contact details

state: 'hidden', triggerElementTarget: '#triggerC' }); + + $('.exampleD').hideShow({ + closeOnClick: true + }); }); (function() { - var target = $('.exampleD'), + var target = $('.exampleE'), buttonContainer = $('
'), buttonRebuild = $(''), buttonDestroy = $(''); @@ -146,7 +165,7 @@

Contact details

})(); (function() { - var target = $('.exampleE'), + var target = $('.exampleF'), buttonContainer = $('
'), buttonRebuild = $(''), buttonDestroy = $(''); @@ -154,7 +173,7 @@

Contact details

target.hideShow({ speed: '600', state: 'hidden', - triggerElementTarget: '#triggerE', + triggerElementTarget: '#triggerF', triggerType: 'button' }); diff --git a/jquery.hideShow.js b/jquery.hideShow.js index 6ec5e27..5823d59 100644 --- a/jquery.hideShow.js +++ b/jquery.hideShow.js @@ -34,6 +34,8 @@ containerCollapsedClass: 'js-hide-show_content--collapsed', // the class name applied to the visible element containerExpandedClass: 'js-hide-show_content--expanded', + // Whether the content closes when clicking elsewhere in the document + closeOnClick: false, // the text to apply to the button/link phrase for the trigger element when visible hideText: 'Hide Content', // Method that is used to insert the trigger button into the location, options are 'after', 'append' 'before' and 'prepend' @@ -174,7 +176,26 @@ event.preventDefault(); self.toggle(); + + // Note that this is meant to work for content that has been triggered + // and not open by default + if (self.options.closeOnClick === true) { + // If open + if (self.element.attr('aria-hidden') === 'false') { + // Hide the content if clicked elsewhere in the document + $(document).mouseup(function(event) { + var content = self.element, + target = event.target; + + // If clicked on elsewhere (nor a descendant of the content) + if (!content.is(target) && content.has(target).length === 0) { + self.close(); + } + }); + } + } }; + return self.handleClick; } diff --git a/jquery.hideShow.min.js b/jquery.hideShow.min.js index 1c0395f..32a27c7 100644 --- a/jquery.hideShow.min.js +++ b/jquery.hideShow.min.js @@ -8,4 +8,4 @@ * @author: Nomensa * @license: licenced under MIT - http://opensource.org/licenses/mit-license.php */ -!function(a,b,c){"use strict";function d(b,d){function e(){if(k.triggerElement=h(),k.element.addClass(k.options.containerClass).attr("id","content-"+g),null!==k.options.insertTriggerLocation&&k.element.attr("tabindex","-1"),"hidden"===k.options.state?(k.element.addClass(k.options.containerCollapsedClass).attr("aria-hidden","true").hide(),k.triggerElement.attr("aria-expanded","false")):(k.element.addClass(k.options.containerExpandedClass).attr("aria-hidden","false").show(),k.triggerElement.attr("aria-expanded","true")),null===k.options.insertTriggerLocation)k.element.before(k.triggerElement);else switch(k.options.insertMethod){case"after":a(k.options.insertTriggerLocation).after(k.triggerElement);break;case"append":a(k.options.insertTriggerLocation).append(k.triggerElement);break;case"prepend":a(k.options.insertTriggerLocation).prepend(k.triggerElement);break;default:a(k.options.insertTriggerLocation).before(k.triggerElement)}g++,k.options.callbackCreate()}function h(){var b,d="content-";return null===k.options.triggerElementTarget?(b=a(c.createElement("button")),b.attr({"aria-controls":d+g,"class":k.options.buttonClass}),a(b).html("hidden"===k.options.state?k.options.showText:k.options.hideText),a(b).click(i(k))):(b=a(k.options.triggerElementTarget),b.attr({"aria-controls":d+g,"class":k.options.buttonClass,role:"button",tabindex:"0"}),a(b).click(i(k)).keydown(j(k))),a(b).addClass("hidden"===k.options.state?k.options.buttonCollapsedClass:k.options.buttonExpandedClass),b}function i(){return k.handleClick=function(a){a.preventDefault(),k.toggle()},k.handleClick}function j(){return k.handleKeyDown=function(a){(13===a.keyCode||32===a.keyCode)&&k.toggle()},k.handleKeyDown}var k=this;k.element=a(b),k.options=a.extend({},f,d),e()}var e,f,g=0;e="hideShow",f={buttonClass:"js-hide-show_btn",buttonCollapsedClass:"js-hide-show_btn--collapsed",buttonExpandedClass:"js-hide-show_btn--expanded",callbackCreate:function(){},callbackDestroy:function(){},containerClass:"js-hide-show_content",containerCollapsedClass:"js-hide-show_content--collapsed",containerExpandedClass:"js-hide-show_content--expanded",hideText:"Hide Content",insertMethod:"before",insertTriggerLocation:null,showText:"Show Content",speed:"slow",state:"shown",triggerElementTarget:null},d.prototype.toggle=function(){"true"===this.element.attr("aria-hidden")?this.open():this.close()},d.prototype.open=function(){var a=this;a.element.addClass(this.options.containerExpandedClass).attr("aria-hidden","false").removeClass(this.options.containerCollapsedClass).slideDown(this.options.speed,function(){null!==a.options.insertTriggerLocation&&a.element.focus()}),a.triggerElement.addClass(this.options.buttonExpandedClass).attr("aria-expanded","true").removeClass(this.options.buttonCollapsedClass),null===a.options.triggerElementTarget&&a.triggerElement.html(this.options.hideText)},d.prototype.close=function(){var a=this;a.element.addClass(this.options.containerCollapsedClass).attr("aria-hidden","true").removeClass(this.options.containerExpandedClass).slideUp(this.options.speed),a.triggerElement.addClass(this.options.buttonCollapsedClass).attr("aria-expanded","false").removeClass(this.options.buttonExpandedClass),null===a.options.triggerElementTarget&&a.triggerElement.html(this.options.showText)},d.prototype.rebuild=function(){return new d(this.element,this.options)},d.prototype.destroy=function(){var b=this.element.attr("id");this.element.removeAttr("aria-hidden id style").removeClass(this.options.containerClass).removeClass(this.options.containerCollapsedClass).removeClass(this.options.containerExpandedClass),null===this.options.triggerElementTarget?(this.triggerElement.remove(),a('[aria-controls="'+b+'"]').remove()):this.triggerElement.off().removeAttr("aria-controls aria-expanded role tabindex").removeClass(this.options.buttonClass).removeClass(this.options.buttonCollapsedClass).removeClass(this.options.buttonExpandedClass),this.options.callbackDestroy()},a.fn[e]=function(b){return this.each(function(){a.data(this,"plugin_"+e)||a.data(this,"plugin_"+e,new d(this,b))})}}(jQuery,window,document); \ No newline at end of file +!function(a,b,c,d){"use strict";function e(b,d){function e(){if(k.triggerElement=f(),k.element.addClass(k.options.containerClass).attr("id","content-"+h),null!==k.options.insertTriggerLocation&&k.element.attr("tabindex","-1"),"hidden"===k.options.state?(k.element.addClass(k.options.containerCollapsedClass).attr("aria-hidden","true").hide(),k.triggerElement.attr("aria-expanded","false")):(k.element.addClass(k.options.containerExpandedClass).attr("aria-hidden","false").show(),k.triggerElement.attr("aria-expanded","true")),null===k.options.insertTriggerLocation)k.element.before(k.triggerElement);else switch(k.options.insertMethod){case"after":a(k.options.insertTriggerLocation).after(k.triggerElement);break;case"append":a(k.options.insertTriggerLocation).append(k.triggerElement);break;case"prepend":a(k.options.insertTriggerLocation).prepend(k.triggerElement);break;default:a(k.options.insertTriggerLocation).before(k.triggerElement)}h++,k.options.callbackCreate()}function f(){var b,d="content-";return null===k.options.triggerElementTarget?(b=a(c.createElement("button")),b.attr({"aria-controls":d+h,"class":k.options.buttonClass}),"hidden"===k.options.state?a(b).html(k.options.showText):a(b).html(k.options.hideText),a(b).click(i(k))):(b=a(k.options.triggerElementTarget),b.attr({"aria-controls":d+h,"class":k.options.buttonClass,role:"button",tabindex:"0"}),a(b).click(i(k)).keydown(j(k))),"hidden"===k.options.state?a(b).addClass(k.options.buttonCollapsedClass):a(b).addClass(k.options.buttonExpandedClass),b}function i(){return k.handleClick=function(b){b.preventDefault(),k.toggle(),k.options.closeOnClick===!0&&"false"===k.element.attr("aria-hidden")&&a(c).mouseup(function(a){var b=k.element,c=a.target;b.is(c)||0!==b.has(c).length||k.close()})},k.handleClick}function j(){return k.handleKeyDown=function(a){(13===a.keyCode||32===a.keyCode)&&k.toggle()},k.handleKeyDown}var k=this;k.element=a(b),k.options=a.extend({},g,d),e()}var f,g,h=0;f="hideShow",g={buttonClass:"js-hide-show_btn",buttonCollapsedClass:"js-hide-show_btn--collapsed",buttonExpandedClass:"js-hide-show_btn--expanded",callbackCreate:function(){},callbackDestroy:function(){},containerClass:"js-hide-show_content",containerCollapsedClass:"js-hide-show_content--collapsed",containerExpandedClass:"js-hide-show_content--expanded",closeOnClick:!1,hideText:"Hide Content",insertMethod:"before",insertTriggerLocation:null,showText:"Show Content",speed:"slow",state:"shown",triggerElementTarget:null},e.prototype.toggle=function(){"true"===this.element.attr("aria-hidden")?this.open():this.close()},e.prototype.open=function(){var a=this;a.element.addClass(this.options.containerExpandedClass).attr("aria-hidden","false").removeClass(this.options.containerCollapsedClass).slideDown(this.options.speed,function(){null!==a.options.insertTriggerLocation&&a.element.focus()}),a.triggerElement.addClass(this.options.buttonExpandedClass).attr("aria-expanded","true").removeClass(this.options.buttonCollapsedClass),null===a.options.triggerElementTarget&&a.triggerElement.html(this.options.hideText)},e.prototype.close=function(){var a=this;a.element.addClass(this.options.containerCollapsedClass).attr("aria-hidden","true").removeClass(this.options.containerExpandedClass).slideUp(this.options.speed),a.triggerElement.addClass(this.options.buttonCollapsedClass).attr("aria-expanded","false").removeClass(this.options.buttonExpandedClass),null===a.options.triggerElementTarget&&a.triggerElement.html(this.options.showText)},e.prototype.rebuild=function(){return new e(this.element,this.options)},e.prototype.destroy=function(){var b=this.element.attr("id");this.element.removeAttr("aria-hidden id style").removeClass(this.options.containerClass).removeClass(this.options.containerCollapsedClass).removeClass(this.options.containerExpandedClass),null===this.options.triggerElementTarget?(this.triggerElement.remove(),a('[aria-controls="'+b+'"]').remove()):this.triggerElement.off().removeAttr("aria-controls aria-expanded role tabindex").removeClass(this.options.buttonClass).removeClass(this.options.buttonCollapsedClass).removeClass(this.options.buttonExpandedClass),this.options.callbackDestroy()},a.fn[f]=function(b){return this.each(function(){a.data(this,"plugin_"+f)||a.data(this,"plugin_"+f,new e(this,b))})}}(jQuery,window,document); \ No newline at end of file diff --git a/jquery.hideShow.spec.js b/jquery.hideShow.spec.js index e2d70ba..afd5523 100644 --- a/jquery.hideShow.spec.js +++ b/jquery.hideShow.spec.js @@ -366,6 +366,28 @@ describe('hide-show', function() { }); it('should trigger "callbackDestroy" once the plugin has been destroyed', function() { + var mocks, + el, + button; + + el = testElement.hideShow({ + closeOnClick: true + }); + button = testElement.siblings('.js-hide-show_btn'); + + // Click to close the content that is open by default + button.click(); + // Click to open the content + button.click(); + // Move the content so that it is off the page + el.hide(); + // Click elsewhere on the page + $(document).mouseup(); + + expect(testElement.attr('aria-hidden')).toBe('true'); + }); + + it('should hide the content if clicked elsewhere in the document', function() { var mocks, el, destroyed = false; From a0da59d31dec2f55a3e98b67dcff37a1430a98ef Mon Sep 17 00:00:00 2001 From: Andrew Nevins Date: Thu, 8 Oct 2015 12:43:55 +0100 Subject: [PATCH 2/5] fixed bug with pressing on the trigger --- jquery.hideShow.js | 6 +++++- jquery.hideShow.min.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/jquery.hideShow.js b/jquery.hideShow.js index 5823d59..291177b 100644 --- a/jquery.hideShow.js +++ b/jquery.hideShow.js @@ -189,7 +189,11 @@ // If clicked on elsewhere (nor a descendant of the content) if (!content.is(target) && content.has(target).length === 0) { - self.close(); + + // If the trigger button is not clicked on + if (!self.triggerElement.is(target)) { + self.close(); + } } }); } diff --git a/jquery.hideShow.min.js b/jquery.hideShow.min.js index 32a27c7..62f8721 100644 --- a/jquery.hideShow.min.js +++ b/jquery.hideShow.min.js @@ -8,4 +8,4 @@ * @author: Nomensa * @license: licenced under MIT - http://opensource.org/licenses/mit-license.php */ -!function(a,b,c,d){"use strict";function e(b,d){function e(){if(k.triggerElement=f(),k.element.addClass(k.options.containerClass).attr("id","content-"+h),null!==k.options.insertTriggerLocation&&k.element.attr("tabindex","-1"),"hidden"===k.options.state?(k.element.addClass(k.options.containerCollapsedClass).attr("aria-hidden","true").hide(),k.triggerElement.attr("aria-expanded","false")):(k.element.addClass(k.options.containerExpandedClass).attr("aria-hidden","false").show(),k.triggerElement.attr("aria-expanded","true")),null===k.options.insertTriggerLocation)k.element.before(k.triggerElement);else switch(k.options.insertMethod){case"after":a(k.options.insertTriggerLocation).after(k.triggerElement);break;case"append":a(k.options.insertTriggerLocation).append(k.triggerElement);break;case"prepend":a(k.options.insertTriggerLocation).prepend(k.triggerElement);break;default:a(k.options.insertTriggerLocation).before(k.triggerElement)}h++,k.options.callbackCreate()}function f(){var b,d="content-";return null===k.options.triggerElementTarget?(b=a(c.createElement("button")),b.attr({"aria-controls":d+h,"class":k.options.buttonClass}),"hidden"===k.options.state?a(b).html(k.options.showText):a(b).html(k.options.hideText),a(b).click(i(k))):(b=a(k.options.triggerElementTarget),b.attr({"aria-controls":d+h,"class":k.options.buttonClass,role:"button",tabindex:"0"}),a(b).click(i(k)).keydown(j(k))),"hidden"===k.options.state?a(b).addClass(k.options.buttonCollapsedClass):a(b).addClass(k.options.buttonExpandedClass),b}function i(){return k.handleClick=function(b){b.preventDefault(),k.toggle(),k.options.closeOnClick===!0&&"false"===k.element.attr("aria-hidden")&&a(c).mouseup(function(a){var b=k.element,c=a.target;b.is(c)||0!==b.has(c).length||k.close()})},k.handleClick}function j(){return k.handleKeyDown=function(a){(13===a.keyCode||32===a.keyCode)&&k.toggle()},k.handleKeyDown}var k=this;k.element=a(b),k.options=a.extend({},g,d),e()}var f,g,h=0;f="hideShow",g={buttonClass:"js-hide-show_btn",buttonCollapsedClass:"js-hide-show_btn--collapsed",buttonExpandedClass:"js-hide-show_btn--expanded",callbackCreate:function(){},callbackDestroy:function(){},containerClass:"js-hide-show_content",containerCollapsedClass:"js-hide-show_content--collapsed",containerExpandedClass:"js-hide-show_content--expanded",closeOnClick:!1,hideText:"Hide Content",insertMethod:"before",insertTriggerLocation:null,showText:"Show Content",speed:"slow",state:"shown",triggerElementTarget:null},e.prototype.toggle=function(){"true"===this.element.attr("aria-hidden")?this.open():this.close()},e.prototype.open=function(){var a=this;a.element.addClass(this.options.containerExpandedClass).attr("aria-hidden","false").removeClass(this.options.containerCollapsedClass).slideDown(this.options.speed,function(){null!==a.options.insertTriggerLocation&&a.element.focus()}),a.triggerElement.addClass(this.options.buttonExpandedClass).attr("aria-expanded","true").removeClass(this.options.buttonCollapsedClass),null===a.options.triggerElementTarget&&a.triggerElement.html(this.options.hideText)},e.prototype.close=function(){var a=this;a.element.addClass(this.options.containerCollapsedClass).attr("aria-hidden","true").removeClass(this.options.containerExpandedClass).slideUp(this.options.speed),a.triggerElement.addClass(this.options.buttonCollapsedClass).attr("aria-expanded","false").removeClass(this.options.buttonExpandedClass),null===a.options.triggerElementTarget&&a.triggerElement.html(this.options.showText)},e.prototype.rebuild=function(){return new e(this.element,this.options)},e.prototype.destroy=function(){var b=this.element.attr("id");this.element.removeAttr("aria-hidden id style").removeClass(this.options.containerClass).removeClass(this.options.containerCollapsedClass).removeClass(this.options.containerExpandedClass),null===this.options.triggerElementTarget?(this.triggerElement.remove(),a('[aria-controls="'+b+'"]').remove()):this.triggerElement.off().removeAttr("aria-controls aria-expanded role tabindex").removeClass(this.options.buttonClass).removeClass(this.options.buttonCollapsedClass).removeClass(this.options.buttonExpandedClass),this.options.callbackDestroy()},a.fn[f]=function(b){return this.each(function(){a.data(this,"plugin_"+f)||a.data(this,"plugin_"+f,new e(this,b))})}}(jQuery,window,document); \ No newline at end of file +!function(a,b,c,d){"use strict";function e(b,d){function e(){if(k.triggerElement=f(),k.element.addClass(k.options.containerClass).attr("id","content-"+h),null!==k.options.insertTriggerLocation&&k.element.attr("tabindex","-1"),"hidden"===k.options.state?(k.element.addClass(k.options.containerCollapsedClass).attr("aria-hidden","true").hide(),k.triggerElement.attr("aria-expanded","false")):(k.element.addClass(k.options.containerExpandedClass).attr("aria-hidden","false").show(),k.triggerElement.attr("aria-expanded","true")),null===k.options.insertTriggerLocation)k.element.before(k.triggerElement);else switch(k.options.insertMethod){case"after":a(k.options.insertTriggerLocation).after(k.triggerElement);break;case"append":a(k.options.insertTriggerLocation).append(k.triggerElement);break;case"prepend":a(k.options.insertTriggerLocation).prepend(k.triggerElement);break;default:a(k.options.insertTriggerLocation).before(k.triggerElement)}h++,k.options.callbackCreate()}function f(){var b,d="content-";return null===k.options.triggerElementTarget?(b=a(c.createElement("button")),b.attr({"aria-controls":d+h,"class":k.options.buttonClass}),"hidden"===k.options.state?a(b).html(k.options.showText):a(b).html(k.options.hideText),a(b).click(i(k))):(b=a(k.options.triggerElementTarget),b.attr({"aria-controls":d+h,"class":k.options.buttonClass,role:"button",tabindex:"0"}),a(b).click(i(k)).keydown(j(k))),"hidden"===k.options.state?a(b).addClass(k.options.buttonCollapsedClass):a(b).addClass(k.options.buttonExpandedClass),b}function i(){return k.handleClick=function(b){b.preventDefault(),k.toggle(),k.options.closeOnClick===!0&&"false"===k.element.attr("aria-hidden")&&a(c).mouseup(function(a){var b=k.element,c=a.target;b.is(c)||0!==b.has(c).length||k.triggerElement.is(c)||k.close()})},k.handleClick}function j(){return k.handleKeyDown=function(a){(13===a.keyCode||32===a.keyCode)&&k.toggle()},k.handleKeyDown}var k=this;k.element=a(b),k.options=a.extend({},g,d),e()}var f,g,h=0;f="hideShow",g={buttonClass:"js-hide-show_btn",buttonCollapsedClass:"js-hide-show_btn--collapsed",buttonExpandedClass:"js-hide-show_btn--expanded",callbackCreate:function(){},callbackDestroy:function(){},containerClass:"js-hide-show_content",containerCollapsedClass:"js-hide-show_content--collapsed",containerExpandedClass:"js-hide-show_content--expanded",closeOnClick:!1,hideText:"Hide Content",insertMethod:"before",insertTriggerLocation:null,showText:"Show Content",speed:"slow",state:"shown",triggerElementTarget:null},e.prototype.toggle=function(){"true"===this.element.attr("aria-hidden")?this.open():this.close()},e.prototype.open=function(){var a=this;a.element.addClass(this.options.containerExpandedClass).attr("aria-hidden","false").removeClass(this.options.containerCollapsedClass).slideDown(this.options.speed,function(){null!==a.options.insertTriggerLocation&&a.element.focus()}),a.triggerElement.addClass(this.options.buttonExpandedClass).attr("aria-expanded","true").removeClass(this.options.buttonCollapsedClass),null===a.options.triggerElementTarget&&a.triggerElement.html(this.options.hideText)},e.prototype.close=function(){var a=this;a.element.addClass(this.options.containerCollapsedClass).attr("aria-hidden","true").removeClass(this.options.containerExpandedClass).slideUp(this.options.speed),a.triggerElement.addClass(this.options.buttonCollapsedClass).attr("aria-expanded","false").removeClass(this.options.buttonExpandedClass),null===a.options.triggerElementTarget&&a.triggerElement.html(this.options.showText)},e.prototype.rebuild=function(){return new e(this.element,this.options)},e.prototype.destroy=function(){var b=this.element.attr("id");this.element.removeAttr("aria-hidden id style").removeClass(this.options.containerClass).removeClass(this.options.containerCollapsedClass).removeClass(this.options.containerExpandedClass),null===this.options.triggerElementTarget?(this.triggerElement.remove(),a('[aria-controls="'+b+'"]').remove()):this.triggerElement.off().removeAttr("aria-controls aria-expanded role tabindex").removeClass(this.options.buttonClass).removeClass(this.options.buttonCollapsedClass).removeClass(this.options.buttonExpandedClass),this.options.callbackDestroy()},a.fn[f]=function(b){return this.each(function(){a.data(this,"plugin_"+f)||a.data(this,"plugin_"+f,new e(this,b))})}}(jQuery,window,document); \ No newline at end of file From 7e0327965ac01279d9ce87d7a42bf587fee1d2ec Mon Sep 17 00:00:00 2001 From: Andrew Nevins Date: Thu, 8 Oct 2015 12:45:39 +0100 Subject: [PATCH 3/5] updated version no. --- jquery.hideShow.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.hideShow.js b/jquery.hideShow.js index 291177b..46d8c4b 100644 --- a/jquery.hideShow.js +++ b/jquery.hideShow.js @@ -3,7 +3,7 @@ * * @description: Inserts an accessible buttons/links to hide and show sections of content * @source: https://github.com/nomensa/jquery.hide-show.git - * @version: '1.0.0' + * @version: '1.0.1' * * @author: Nomensa * @license: licenced under MIT - http://opensource.org/licenses/mit-license.php From f6540babd505b72302da56ca3fe3b26af177c21d Mon Sep 17 00:00:00 2001 From: Andrew Nevins Date: Thu, 8 Oct 2015 12:46:34 +0100 Subject: [PATCH 4/5] updated version number in minified file --- jquery.hideShow.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.hideShow.min.js b/jquery.hideShow.min.js index 62f8721..40a1dbe 100644 --- a/jquery.hideShow.min.js +++ b/jquery.hideShow.min.js @@ -3,7 +3,7 @@ * * @description: Inserts an accessible buttons/links to hide and show sections of content * @source: https://github.com/nomensa/jquery.hide-show.git - * @version: '1.0.0' + * @version: '1.0.1' * * @author: Nomensa * @license: licenced under MIT - http://opensource.org/licenses/mit-license.php From bcdfe9a53b9dbb6fa87552055dd4ab467e3602c0 Mon Sep 17 00:00:00 2001 From: Andrew Nevins Date: Thu, 8 Oct 2015 12:54:29 +0100 Subject: [PATCH 5/5] updated readme --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index dab4489..b55a927 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,12 @@ Type: `function` Description: Callback when the plugin is destroyed +### closeOnClick + +Type: `boolean` + +Description: Collapses the content when clicking elsewhere on the page. This only works if the content has been triggered to begin with and not open by default. + ### containerClass Type: `string`