JavaScript "strict mode" fixes

This commit is contained in:
jdomnitz 2012-02-12 19:58:56 -05:00 committed by Scott González
parent adaba7790b
commit 57fe6ed01d
3 changed files with 4 additions and 6 deletions

View File

@ -414,7 +414,7 @@ $.ui.position = {
// fraction support test // fraction support test
(function () { (function () {
var testElement, testElementParent, testElementStyle, offsetLeft, i var testElement, testElementParent, testElementStyle, offsetLeft, i,
body = document.getElementsByTagName( "body" )[ 0 ], body = document.getElementsByTagName( "body" )[ 0 ],
div = document.createElement( "div" ); div = document.createElement( "div" );

View File

@ -947,9 +947,7 @@ if ( $.uiBackCompat !== false ) {
// cookie option // cookie option
var listId = 0; var listId = 0;
function getNextListId() {
return ++listId;
}
$.widget( "ui.tabs", $.ui.tabs, { $.widget( "ui.tabs", $.ui.tabs, {
options: { options: {
cookie: null // e.g. { expires: 7, path: '/', domain: 'jquery.com', secure: true } cookie: null // e.g. { expires: 7, path: '/', domain: 'jquery.com', secure: true }
@ -968,7 +966,7 @@ if ( $.uiBackCompat !== false ) {
}, },
_cookie: function( active ) { _cookie: function( active ) {
var cookie = [ this.cookie || var cookie = [ this.cookie ||
( this.cookie = this.options.cookie.name || "ui-tabs-" + getNextListId() ) ]; ( this.cookie = this.options.cookie.name || "ui-tabs-" + ++listId ) ];
if ( arguments.length ) { if ( arguments.length ) {
cookie.push( active === false ? -1 : active ); cookie.push( active === false ? -1 : active );
cookie.push( this.options.cookie ); cookie.push( this.options.cookie );

View File

@ -182,7 +182,7 @@ $.widget.bridge = function( name, object ) {
if ( instance ) { if ( instance ) {
instance.option( options || {} )._init(); instance.option( options || {} )._init();
} else { } else {
object( options, this ); new object( options, this );
} }
}); });
} }