Skip to content
This repository has been archived by the owner on Jun 14, 2020. It is now read-only.

Commit

Permalink
Fixed issue with sanitization that broke viewport defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
Craga89 committed Apr 11, 2011
1 parent f9340dd commit 3123572
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 25 deletions.
13 changes: 6 additions & 7 deletions dist/jquery.qtip.basic.js
Expand Up @@ -9,7 +9,7 @@
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Mon Apr 11 17:44:04 2011 +0100
* Date: Mon Apr 11 19:54:32 2011 +0100
*/

"use strict"; // Enable ECMAScript "strict" operation for this function. See more: http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/
Expand Down Expand Up @@ -87,11 +87,10 @@ function sanitizeOptions(opts)
};
}

if('object' !== typeof opts.position.adjust) {
opts.position.adjust = {};
}
if('string' !== typeof opts.position.adjust.method) {
opts.position.adjust.method = String(opts.position.adjust.method).toLowerCase();
if('adjust' in opts.position) {
if(!(/flip|shift( horizontal| vertical)*/i).test(opts.position.adjust.method)) {
delete opts.position.adjust.method;
}
}
}

Expand Down Expand Up @@ -129,7 +128,7 @@ function sanitizeOptions(opts)
$.each(PLUGINS, function() {
if(this.sanitize) { this.sanitize(opts); }
});

return opts;
}

Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.qtip.css
Expand Up @@ -9,7 +9,7 @@
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Mon Apr 11 17:44:04 2011 +0100
* Date: Mon Apr 11 19:54:32 2011 +0100
*/

/* Fluid class for determining actual width in IE */
Expand Down
13 changes: 6 additions & 7 deletions dist/jquery.qtip.js
Expand Up @@ -9,7 +9,7 @@
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Mon Apr 11 17:44:04 2011 +0100
* Date: Mon Apr 11 19:54:32 2011 +0100
*/

"use strict"; // Enable ECMAScript "strict" operation for this function. See more: http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/
Expand Down Expand Up @@ -87,11 +87,10 @@ function sanitizeOptions(opts)
};
}

if('object' !== typeof opts.position.adjust) {
opts.position.adjust = {};
}
if('string' !== typeof opts.position.adjust.method) {
opts.position.adjust.method = String(opts.position.adjust.method).toLowerCase();
if('adjust' in opts.position) {
if(!(/flip|shift( horizontal| vertical)*/i).test(opts.position.adjust.method)) {
delete opts.position.adjust.method;
}
}
}

Expand Down Expand Up @@ -129,7 +128,7 @@ function sanitizeOptions(opts)
$.each(PLUGINS, function() {
if(this.sanitize) { this.sanitize(opts); }
});

return opts;
}

Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.qtip.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/jquery.qtip.pack.js

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions src/core.js
Expand Up @@ -45,11 +45,10 @@ function sanitizeOptions(opts)
};
}

if('object' !== typeof opts.position.adjust) {
opts.position.adjust = {};
}
if('string' !== typeof opts.position.adjust.method) {
opts.position.adjust.method = String(opts.position.adjust.method).toLowerCase();
if('adjust' in opts.position) {
if(!(/flip|shift( horizontal| vertical)*/i).test(opts.position.adjust.method)) {
delete opts.position.adjust.method;
}
}
}

Expand Down Expand Up @@ -87,7 +86,7 @@ function sanitizeOptions(opts)
$.each(PLUGINS, function() {
if(this.sanitize) { this.sanitize(opts); }
});

return opts;
}

Expand Down

0 comments on commit 3123572

Please sign in to comment.