Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compatibilty for zepto #20

merged 3 commits into from Apr 23, 2013
Changes from all commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.


Just for now

@@ -1,7 +1,7 @@
module.exports = function(grunt) {
qunit: {
files: ['test/index.html']
files: ['test/*.html']

@@ -88,7 +88,8 @@
return typeof mask == "function" ? mask(__p.getVal(), e, options) : mask;
setVal: function(v) {
return $el.get(0).tagName.toLowerCase() === "input" ? $el.val(v) : $el.html(v);
$el.get(0).tagName.toLowerCase() === "input" ? $el.val(v) : $el.html(v);

This comment has been minimized.


igorescobar Apr 22, 2013

Hi @igorlima why did you have to change this line? (Curiosity)?

This comment has been minimized.


igorlima Apr 22, 2013
Author Contributor

Using jQuery, the return of val(undefined) and html(undefined) methods is the own element.
Using Zepto, the return of those methods (if the param is undefined) wasn't the own element.
If the param has a different value than undefined, everything works ok.

return $el;
getVal: function() {
return $el.get(0).tagName.toLowerCase() === "input" ? $el.val() : $el.text();
@@ -249,4 +250,4 @@

})(window.jQuery || window.Zepto);
@@ -0,0 +1,22 @@
<title>Zepto-Mask-Plugin UnitTesting</title>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src="../jquery.mask.js"></script>
<script type="text/javascript" src=""></script>
<link rel="stylesheet" href="" type="text/css" media="all">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="jquery.mask.test.js"></script>

<h1 id="qunit-header">Zepto-Mask-Plugin QUnit Tests</h1>
<h2 id="qunit-banner"></h2>
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<div id="qunit-fixture">test markup, will be hidden</div>
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.