From 57fe6ed01d07162fa3c9f7893137c1be509fa625 Mon Sep 17 00:00:00 2001 From: jdomnitz Date: Sun, 12 Feb 2012 19:58:56 -0500 Subject: [PATCH] JavaScript "strict mode" fixes --- ui/jquery.ui.position.js | 2 +- ui/jquery.ui.tabs.js | 6 ++---- ui/jquery.ui.widget.js | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ui/jquery.ui.position.js b/ui/jquery.ui.position.js index 119847cec..b8bb2c883 100644 --- a/ui/jquery.ui.position.js +++ b/ui/jquery.ui.position.js @@ -414,7 +414,7 @@ $.ui.position = { // fraction support test (function () { - var testElement, testElementParent, testElementStyle, offsetLeft, i + var testElement, testElementParent, testElementStyle, offsetLeft, i, body = document.getElementsByTagName( "body" )[ 0 ], div = document.createElement( "div" ); diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js index dc52591b9..6e5cde07e 100644 --- a/ui/jquery.ui.tabs.js +++ b/ui/jquery.ui.tabs.js @@ -947,9 +947,7 @@ if ( $.uiBackCompat !== false ) { // cookie option var listId = 0; - function getNextListId() { - return ++listId; - } + $.widget( "ui.tabs", $.ui.tabs, { options: { cookie: null // e.g. { expires: 7, path: '/', domain: 'jquery.com', secure: true } @@ -968,7 +966,7 @@ if ( $.uiBackCompat !== false ) { }, _cookie: function( active ) { 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 ) { cookie.push( active === false ? -1 : active ); cookie.push( this.options.cookie ); diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js index bf26373e1..2d48ae26d 100644 --- a/ui/jquery.ui.widget.js +++ b/ui/jquery.ui.widget.js @@ -182,7 +182,7 @@ $.widget.bridge = function( name, object ) { if ( instance ) { instance.option( options || {} )._init(); } else { - object( options, this ); + new object( options, this ); } }); }