Skip to content

Commit

Permalink
Fix reset on radio/checkbox input. bump 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumepotier committed Mar 27, 2017
1 parent ffecc7f commit e8bb774
Show file tree
Hide file tree
Showing 10 changed files with 7,337 additions and 79 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.DS_Store
/node_modules
/bower_components
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ http://garlicjs.org/

#Version

1.2.4
1.3.0

See CHANGELOG for more info.

Expand Down
13 changes: 7 additions & 6 deletions component.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "garlicjs",
"version": "1.2.4",
"main": "./dist/garlic.min.js",
"dependencies": {
"jquery": "*"
}
"name": "garlicjs",
"version": "1.2.4",
"main": "./dist/garlic.min.js",
"dependencies": {
"jquery": "*",
"bootstrap": "^3.3.7"
}
}
50 changes: 4 additions & 46 deletions dist/garlic-standalone.min.js

Large diffs are not rendered by default.

15 changes: 2 additions & 13 deletions dist/garlic.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions garlic.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
this.$element.on( this.options.events.join( '.' + this.type + ' ') , false, $.proxy( this.persist, this ) );

if ( this.options.destroy ) {
$( this.parentForm ).on( 'submit reset' , false, $.proxy( this.destroy, this ) );
$( this.parentForm ).on( 'submit reset' , false, $.proxy( this.remove, this ) );
}

// retrieve garlic persisted data
Expand Down Expand Up @@ -279,10 +279,10 @@

/* remove data / reset state AND delete localStorage */
, remove: function () {
this.remove();
this.destroy();

if ( this.$element.is( 'input[type=radio], input[type=checkbox]' ) ) {
$( this.$element ).prop( 'checked', false );
$( this.$element ).attr( 'checked', false );
return;
}

Expand Down Expand Up @@ -431,7 +431,7 @@
$.fn.garlic.defaults = {
destroy: true // Remove or not localstorage on submit & clear
, inputs: 'input, textarea, select' // Default supported inputs.
, excluded: 'input[type="file"], input[type="hidden"], input[type="submit"]' // Default ignored inputs.
, excluded: 'input[type="file"], input[type="hidden"], input[type="submit"], input[type="reset"]' // Default ignored inputs.
, events: [ 'DOMAttrModified', 'textInput', 'input', 'change', 'click', 'keypress', 'paste', 'focus' ] // Events list that trigger a localStorage
, domain: false // Store et retrieve forms data accross all domain, not just on
, expires: false // false for no expiration, otherwise (int) in seconds for auto-expiration
Expand Down
15 changes: 7 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
<meta name="author" content="">

<!-- Le styles -->
<link href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" rel="stylesheet">
<link href="http://twitter.github.com/bootstrap/assets/css/bootstrap-responsive.css" rel="stylesheet">
<link href="http://twitter.github.com/bootstrap/assets/css/docs.css" rel="stylesheet">
<link href="./resources/bootstrap-2.3.2.css" rel="stylesheet">
<link href="./resources/docs.css" rel="stylesheet">
<link href="http://yandex.st/highlightjs/7.3/styles/github.min.css" rel="stylesheet">

<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
Expand Down Expand Up @@ -120,10 +119,10 @@ <h1 class="">

<div class="row well intro">
<div id="head-download" class="download">
<a href="https://github.com/guillaumepotier/Garlic.js/archive/1.2.3.zip">
<a href="https://github.com/guillaumepotier/Garlic.js/archive/1.3.0.zip">
<img width="90" border="0" src="http://github.com/images/modules/download/zip.png" onclick="onclick=”var that=this;_gaq.push(['_trackEvent','Download','ZIP',this.href]);setTimeout(function(){location.href=that.href;},200);return false;”">
</a>
<a href="https://github.com/guillaumepotier/Garlic.js/archive/1.2.3.tar.gz">
<a href="https://github.com/guillaumepotier/Garlic.js/archive/1.3.0.tar.gz">
<img width="90" border="0" src="http://github.com/images/modules/download/tar.png" onclick="onclick=”var that=this;_gaq.push(['_trackEvent','Download','TAR',this.href]);setTimeout(function(){location.href=that.href;},200);return false;”">
</a>
</div>
Expand Down Expand Up @@ -313,10 +312,10 @@ <h1>Requirements / Compatibility</h1>
<h1>Download</h1>
</div>
<div id="download" class="download">
<a href="https://github.com/guillaumepotier/Garlic.js/archive/1.2.3.zip" onclick="onclick=”var that=this;_gaq.push(['_trackEvent','Download','ZIP',this.href]);setTimeout(function(){location.href=that.href;},200);return false;”" >
<a href="https://github.com/guillaumepotier/Garlic.js/archive/1.3.0.zip" onclick="onclick=”var that=this;_gaq.push(['_trackEvent','Download','ZIP',this.href]);setTimeout(function(){location.href=that.href;},200);return false;”" >
<img width="90" border="0" src="http://github.com/images/modules/download/zip.png">
</a>
<a href="https://github.com/guillaumepotier/Garlic.js/archive/1.2.3.tar.gz" onclick="onclick=”var that=this;_gaq.push(['_trackEvent','Download','TAR',this.href]);setTimeout(function(){location.href=that.href;},200);return false;”">
<a href="https://github.com/guillaumepotier/Garlic.js/archive/1.3.0tar.gz" onclick="onclick=”var that=this;_gaq.push(['_trackEvent','Download','TAR',this.href]);setTimeout(function(){location.href=that.href;},200);return false;”">
<img width="90" border="0" src="http://github.com/images/modules/download/tar.png">
</a>
</div>
Expand Down Expand Up @@ -438,7 +437,7 @@ <h1>Other stuff</h1>
<div class="page-header">
<h1>Version / Licence</h1>
</div>
<a href="https://github.com/guillaumepotier/Garlic.js/blob/master/README.md">1.2.3 - MIT</a> - <a href="https://github.com/guillaumepotier/Garlic.js/blob/master/CHANGELOG.md">See changelog</a>
<a href="https://github.com/guillaumepotier/Garlic.js/blob/master/README.md">1.3.0 - MIT</a> - <a href="https://github.com/guillaumepotier/Garlic.js/blob/master/CHANGELOG.md">See changelog</a>
<a href="#top" class="pull-right">Top</a>
</section>
</div>
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": "Garlic.js",
"version": "1.2.3",
"version": "1.3.0",
"description": "Automatically persist your forms' text and select field values locally, until the form is submitted.",
"main": "garlic.js",
"directories": {
Expand Down
Loading

0 comments on commit e8bb774

Please sign in to comment.