Skip to content

Commit

Permalink
Fixed freefocus('cache'). Version 0.10.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Flamefork committed Sep 3, 2015
1 parent c19de3d commit 208c6ba
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ Hints could be specified using

## Changelog

- 0.10.2 Fixed `freefocus('cache')`
- 0.10.1 Removed lots of jQuery calls from code, speedup is imminent
- 0.10.0 Supported `targets` option to be a function that returns focusable elements instead of using `focusablesSelector` and `focusablesFilter`
- 0.9.0 Freefocus returns focus target (or self if no target found) instead of self
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jquery-freefocus",
"version": "0.10.1",
"version": "0.10.2",
"main": "dist/jquery.freefocus.js",
"dependencies": {},
"devDependencies": {
Expand Down
15 changes: 9 additions & 6 deletions jquery.freefocus.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
jQuery.Freefocus 0.10.1
jQuery.Freefocus 0.10.2
Copyright (c) 2013-2015 Ilia Ablamonov. Licensed under the MIT license.
Expand Down Expand Up @@ -190,8 +190,8 @@ Copyright (c) 2013-2015 Ilia Ablamonov. Licensed under the MIT license.
if ($.freefocus.moves[options.move] === null) {
throw new Error('Unknown move direction "' + options.move + '"');
}
if (!options.targets || !(options.targets instanceof $ || $.isFunction(options.targets))) {
throw new Error('Argument targets should be a jQuery object or function');
if (!($.isFunction(options.targets) || $.isArray(options.targets) || options.targets.jquery)) {
throw new Error('Argument targets should be a function, array, or jQuery object');
}

if (options.debug) {
Expand Down Expand Up @@ -585,9 +585,12 @@ Copyright (c) 2013-2015 Ilia Ablamonov. Licensed under the MIT license.
function cacheFocusables(options) {
options = $.extend({}, $.freefocus.cacheOptions, options);

var targets = options.targets(options);
targets.each(function () {
getElementBox(this, true, true);
var targets = options.targets;
if ($.isFunction(targets)) {
targets = targets(options);
}
$.each(targets, function (i, el) {
getElementBox(el, true, true);
});
}

Expand Down
2 changes: 1 addition & 1 deletion jquery.freefocus.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 package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "freefocus",
"version": "0.10.1",
"version": "0.10.2",
"description": "FreeFocus",
"keywords": [
"jquery-plugin"
Expand Down

0 comments on commit 208c6ba

Please sign in to comment.