Skip to content

Commit 28cab11

Browse files
authored
Merge pull request #15 from cyky/add_setclean
Added option to manualy set state clean
2 parents d9ba8ef + 85d4f0f commit 28cab11

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

dist/jquery.dirrty.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ var singleDs = [];
153153

154154
$.fn.dirrty = function(options) {
155155

156-
if (/^(isDirty)$/i.test(options)) {
156+
if (/^(isDirty)$/i.test(options) || /^(setClean)$/i.test(options)) {
157157
//Check if we have an instance of dirrty for this form
158158
var d = getSingleton($(this).attr("id"));
159159

@@ -164,7 +164,9 @@ var singleDs = [];
164164
switch(options){
165165
case 'isDirty':
166166
return d.isDirty;
167-
break;
167+
case 'setClean':
168+
d.setClean();
169+
return true;
168170
}
169171

170172
}else if (typeof options == 'object' || !options) {

0 commit comments

Comments
 (0)