Skip to content

Commit

Permalink
#1210: Improve UIKit class; Upgrade to UIKit 2.13.1
Browse files Browse the repository at this point in the history
  • Loading branch information
nghuuphuoc committed Dec 5, 2014
1 parent a146617 commit 82651f6
Show file tree
Hide file tree
Showing 16 changed files with 64 additions and 44 deletions.
4 changes: 2 additions & 2 deletions demo/uikit/horizontalForm.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>FormValidation &rarr; UIKit demo</title>

<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/uikit/2.12.0/css/uikit.min.css"/>
<link rel="stylesheet" href="http://cdn.jsdelivr.net/uikit/2.13.1/css/uikit.min.css"/>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" />
<link rel="stylesheet" href="../../dist/css/formValidation.css"/>

<script type="text/javascript" src="../../vendor/jquery/jquery.min.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/uikit/2.12.0/js/uikit.min.js"></script>
<script type="text/javascript" src="http://cdn.jsdelivr.net/uikit/2.13.1/js/uikit.min.js"></script>

<script type="text/javascript" src="../../dist/js/formValidation.js"></script>
<script type="text/javascript" src="../../dist/js/framework/uikit.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions demo/uikit/horizontalFormTooltip.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>FormValidation &rarr; UIKit demo</title>

<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/uikit/2.12.0/css/uikit.min.css"/>
<link rel="stylesheet" href="http://cdn.jsdelivr.net/uikit/2.13.1/css/uikit.min.css"/>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" />
<link rel="stylesheet" href="../../dist/css/formValidation.css"/>

<script type="text/javascript" src="../../vendor/jquery/jquery.min.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/uikit/2.12.0/js/uikit.min.js"></script>
<script type="text/javascript" src="http://cdn.jsdelivr.net/uikit/2.13.1/js/uikit.min.js"></script>

<script type="text/javascript" src="../../dist/js/formValidation.js"></script>
<script type="text/javascript" src="../../dist/js/framework/uikit.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions demo/uikit/stackedForm.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>FormValidation &rarr; UIKit demo</title>

<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/uikit/2.12.0/css/uikit.min.css"/>
<link rel="stylesheet" href="http://cdn.jsdelivr.net/uikit/2.13.1/css/uikit.min.css"/>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" />
<link rel="stylesheet" href="../../dist/css/formValidation.css"/>

<script type="text/javascript" src="../../vendor/jquery/jquery.min.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/uikit/2.12.0/js/uikit.min.js"></script>
<script type="text/javascript" src="http://cdn.jsdelivr.net/uikit/2.13.1/js/uikit.min.js"></script>

<script type="text/javascript" src="../../dist/js/formValidation.js"></script>
<script type="text/javascript" src="../../dist/js/framework/uikit.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions demo/uikit/stackedFormTooltip.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>FormValidation &rarr; UIKit demo</title>

<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/uikit/2.12.0/css/uikit.min.css"/>
<link rel="stylesheet" href="http://cdn.jsdelivr.net/uikit/2.13.1/css/uikit.min.css"/>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" />
<link rel="stylesheet" href="../../dist/css/formValidation.css"/>

<script type="text/javascript" src="../../vendor/jquery/jquery.min.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/uikit/2.12.0/js/uikit.min.js"></script>
<script type="text/javascript" src="http://cdn.jsdelivr.net/uikit/2.13.1/js/uikit.min.js"></script>

<script type="text/javascript" src="../../dist/js/formValidation.js"></script>
<script type="text/javascript" src="../../dist/js/framework/uikit.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion dist/css/formValidation.min.css

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

2 changes: 1 addition & 1 deletion dist/js/formValidation.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* FormValidation (http://bootstrapvalidator.com)
* The best jQuery plugin to validate form fields. Support Bootstrap, Foundation, SemanticUI, UIKit frameworks
*
* @version v0.6.0-dev, built on 2014-12-05 8:45:48 AM
* @version v0.6.0-dev, built on 2014-12-05 11:57:55 PM
* @author https://twitter.com/nghuuphuoc
* @copyright (c) 2013 - 2014 Nguyen Huu Phuoc
* @license http://bootstrapvalidator.com/license/
Expand Down
2 changes: 1 addition & 1 deletion dist/js/formValidation.min.js

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

2 changes: 1 addition & 1 deletion dist/js/framework/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* FormValidation (http://bootstrapvalidator.com)
* The best jQuery plugin to validate form fields. Support Bootstrap, Foundation, SemanticUI, UIKit frameworks
*
* @version v0.6.0-dev, built on 2014-12-05 8:45:49 AM
* @version v0.6.0-dev, built on 2014-12-05 11:57:55 PM
* @author https://twitter.com/nghuuphuoc
* @copyright (c) 2013 - 2014 Nguyen Huu Phuoc
* @license http://bootstrapvalidator.com/license/
Expand Down
2 changes: 1 addition & 1 deletion dist/js/framework/bootstrap.min.js

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

2 changes: 1 addition & 1 deletion dist/js/framework/foundation.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* FormValidation (http://bootstrapvalidator.com)
* The best jQuery plugin to validate form fields. Support Bootstrap, Foundation, SemanticUI, UIKit frameworks
*
* @version v0.6.0-dev, built on 2014-12-05 8:45:49 AM
* @version v0.6.0-dev, built on 2014-12-05 11:57:55 PM
* @author https://twitter.com/nghuuphuoc
* @copyright (c) 2013 - 2014 Nguyen Huu Phuoc
* @license http://bootstrapvalidator.com/license/
Expand Down
2 changes: 1 addition & 1 deletion dist/js/framework/foundation.min.js

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

2 changes: 1 addition & 1 deletion dist/js/framework/semantic.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* FormValidation (http://bootstrapvalidator.com)
* The best jQuery plugin to validate form fields. Support Bootstrap, Foundation, SemanticUI, UIKit frameworks
*
* @version v0.6.0-dev, built on 2014-12-05 8:45:49 AM
* @version v0.6.0-dev, built on 2014-12-05 11:57:55 PM
* @author https://twitter.com/nghuuphuoc
* @copyright (c) 2013 - 2014 Nguyen Huu Phuoc
* @license http://bootstrapvalidator.com/license/
Expand Down
2 changes: 1 addition & 1 deletion dist/js/framework/semantic.min.js

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

36 changes: 23 additions & 13 deletions dist/js/framework/uikit.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* FormValidation (http://bootstrapvalidator.com)
* The best jQuery plugin to validate form fields. Support Bootstrap, Foundation, SemanticUI, UIKit frameworks
*
* @version v0.6.0-dev, built on 2014-12-05 8:45:49 AM
* @version v0.6.0-dev, built on 2014-12-05 11:57:55 PM
* @author https://twitter.com/nghuuphuoc
* @copyright (c) 2013 - 2014 Nguyen Huu Phuoc
* @license http://bootstrapvalidator.com/license/
Expand Down Expand Up @@ -73,12 +73,21 @@
_createTooltip: function($field, message, type) {
var $icon = $field.data('fv.icon');
if ($icon) {
// Remove the tooltip if it's already exists
if ($icon.data('tooltip')) {
$icon.data('tooltip').off();
$icon.removeData('tooltip');
}

$icon
.attr('title', message)
.css({
'cursor': 'pointer'
})
.data('fv.uikit.tooltip', new $.UIkit.tooltip($icon));
});

new $.UIkit.tooltip($icon);
// UIKit auto set the 'tooltip' data for the element
// so I can retrieve the tooltip later via $icon.data('tooltip')
}
},

Expand All @@ -91,15 +100,16 @@
_destroyTooltip: function($field, type) {
var $icon = $field.data('fv.icon');
if ($icon) {
$icon.css({
'cursor': ''
});
var tooltip = $icon.data('fv.uikit.tooltip');
var tooltip = $icon.data('tooltip');
if (tooltip) {
tooltip.hide();
tooltip.off();
$icon.off('focus mouseenter')
.removeData('fv.uikit.tooltip');
.removeData('tooltip');
}
$icon.css({
'cursor': ''
});
}
},

Expand All @@ -112,13 +122,13 @@
_hideTooltip: function($field, type) {
var $icon = $field.data('fv.icon');
if ($icon) {
$icon.css({
'cursor': ''
});
var tooltip = $icon.data('fv.uikit.tooltip');
var tooltip = $icon.data('tooltip');
if (tooltip) {
tooltip.hide();
}
$icon.css({
'cursor': ''
});
}
},

Expand All @@ -134,7 +144,7 @@
$icon.css({
'cursor': 'pointer'
});
var tooltip = $icon.data('fv.uikit.tooltip');
var tooltip = $icon.data('tooltip');
if (tooltip) {
tooltip.show();
}
Expand Down
4 changes: 2 additions & 2 deletions dist/js/framework/uikit.min.js

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

34 changes: 22 additions & 12 deletions src/js/framework/uikit.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,21 @@
_createTooltip: function($field, message, type) {
var $icon = $field.data('fv.icon');
if ($icon) {
// Remove the tooltip if it's already exists
if ($icon.data('tooltip')) {
$icon.data('tooltip').off();
$icon.removeData('tooltip');
}

$icon
.attr('title', message)
.css({
'cursor': 'pointer'
})
.data('fv.uikit.tooltip', new $.UIkit.tooltip($icon));
});

new $.UIkit.tooltip($icon);
// UIKit auto set the 'tooltip' data for the element
// so I can retrieve the tooltip later via $icon.data('tooltip')
}
},

Expand All @@ -91,15 +100,16 @@
_destroyTooltip: function($field, type) {
var $icon = $field.data('fv.icon');
if ($icon) {
$icon.css({
'cursor': ''
});
var tooltip = $icon.data('fv.uikit.tooltip');
var tooltip = $icon.data('tooltip');
if (tooltip) {
tooltip.hide();
tooltip.off();
$icon.off('focus mouseenter')
.removeData('fv.uikit.tooltip');
.removeData('tooltip');
}
$icon.css({
'cursor': ''
});
}
},

Expand All @@ -112,13 +122,13 @@
_hideTooltip: function($field, type) {
var $icon = $field.data('fv.icon');
if ($icon) {
$icon.css({
'cursor': ''
});
var tooltip = $icon.data('fv.uikit.tooltip');
var tooltip = $icon.data('tooltip');
if (tooltip) {
tooltip.hide();
}
$icon.css({
'cursor': ''
});
}
},

Expand All @@ -134,7 +144,7 @@
$icon.css({
'cursor': 'pointer'
});
var tooltip = $icon.data('fv.uikit.tooltip');
var tooltip = $icon.data('tooltip');
if (tooltip) {
tooltip.show();
}
Expand Down

0 comments on commit 82651f6

Please sign in to comment.