Skip to content

Commit a6e3a12

Browse files
committed
Merge pull request #99 from alfredobarron/dev
Dev
2 parents 442f98c + 4ea0b62 commit a6e3a12

21 files changed

+126
-110
lines changed

Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ module.exports = function(grunt){
3636
compress: {
3737
main: {
3838
options: {
39-
archive: 'smoke-v3.0.0.zip'
39+
archive: 'smoke-v3.0.1.zip'
4040
},
4141
files: [
4242
//{src: ['path/*'], dest: 'internal_folder/', filter: 'isFile'}, // includes files in path

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ All contributions are very welcome, We love it. There are several ways to help o
6363
There are a few guidelines that we need contributors to follow so that we have a chance of keeping on top of things.
6464

6565

66-
If you want to making changes Better avoid working directly on the master branch, to avoid conflicts if you pull in updates from origin, so, if make your contribution under the branch [`dev`](https://github.com/alfredobarron/smoke/tree/dev).
66+
If you want to making changes Better avoid working directly on the master branch, to avoid conflicts if you pull in updates from origin, so, if make your contribution under the branch [`dev`](https://github.com/alfredobarron/smoke/tree/dev), into folder `docs/src/`.
6767

6868

6969
##Community

dist/js/smoke.js

Lines changed: 51 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@
111111
// Se obtiene el nivel de la fuerza de la contraseña
112112
var smkStrongPass = $(v).attr('data-smk-strongPass');
113113

114+
// Se eliminan los mensajes de error
114115
$.smkRemoveError(input);
115116

116117
// Se obtiene el value de los input RADIO y/o CHECKBOX
@@ -411,53 +412,60 @@
411412
$.fn.smkClear = function() {
412413

413414
// Se obtienen todos los inputs
414-
var inputs = (this.is(':input')) ? $(this) : $(':input:not(:button):not(:disabled):not([data-smk-noclear])', this);
415+
var inputs = (this.is(':input')) ? $(this) : $(':input:not(:button)', this);
415416

416417
// Se recorren todos los inputs del formulario
417418
inputs.each(function(k,v) {
418-
//Se obtiene el type y el tag del input
419-
var type = this.type;
420-
var tag = this.tagName.toLowerCase();
421-
//Si el tag trae el valor 'input' se sustituye por el valor type
422-
if (tag == 'input') {
423-
tag = type;
424-
}
425-
//Se compara el type y se limpia
426-
switch (type) {
427-
case 'text':
428-
case 'password':
429-
case 'email':
430-
case 'number':
431-
case 'hidden':
432-
case 'date':
433-
case 'datetime':
434-
case 'datetime-local':
435-
case 'month':
436-
case 'week':
437-
case 'time':
438-
case 'tel':
439-
case 'url':
440-
case 'search':
441-
case 'range':
442-
case 'color':
443-
this.value = '';
444-
break;
445-
case 'checkbox':
446-
case 'radio':
447-
this.checked = false;
448-
break;
449-
}
450-
//Se compara el tag y se limpia
451-
switch (tag) {
452-
case 'textarea':
453-
this.value = '';
454-
break;
455-
case 'select':
456-
this.selectedIndex = -1;
457-
if($(this).hasClass('select2')){
458-
$(this).select2('val', '');
419+
420+
// Se eliminan los mensajes de error
421+
$.smkRemoveError(v);
422+
423+
// Si el input no contiene el attr data-smk-noclear
424+
if ( $(v).attr('data-smk-noclear') === undefined ) {
425+
//Se obtiene el type y el tag del input
426+
var type = this.type;
427+
var tag = this.tagName.toLowerCase();
428+
//Si el tag trae el valor 'input' se sustituye por el valor type
429+
if (tag == 'input') {
430+
tag = type;
431+
}
432+
//Se compara el type y se limpia
433+
switch (type) {
434+
case 'text':
435+
case 'password':
436+
case 'email':
437+
case 'number':
438+
case 'hidden':
439+
case 'date':
440+
case 'datetime':
441+
case 'datetime-local':
442+
case 'month':
443+
case 'week':
444+
case 'time':
445+
case 'tel':
446+
case 'url':
447+
case 'search':
448+
case 'range':
449+
case 'color':
450+
this.value = '';
451+
break;
452+
case 'checkbox':
453+
case 'radio':
454+
this.checked = false;
455+
break;
456+
}
457+
//Se compara el tag y se limpia
458+
switch (tag) {
459+
case 'textarea':
460+
this.value = '';
461+
break;
462+
case 'select':
463+
this.selectedIndex = 0;
464+
if($(this).hasClass('select2')){
465+
$(this).select2('val', '');
466+
}
467+
break;
459468
}
460-
break;
461469
}
462470
});
463471
//$(this)[0].reset();

dist/js/smoke.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/lang/ar.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/lang/de.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/lang/es.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/lang/fr.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)