Skip to content

Commit 8a32c39

Browse files
committed
Core: Moved old jQuery support code to the bottom (above deprecated).
1 parent 02694a9 commit 8a32c39

File tree

1 file changed

+47
-47
lines changed

1 file changed

+47
-47
lines changed

ui/jquery.ui.core.js

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -128,53 +128,6 @@ $.fn.extend({
128128
}
129129
});
130130

131-
// support: jQuery <1.8
132-
if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
133-
$.each( [ "Width", "Height" ], function( i, name ) {
134-
var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
135-
type = name.toLowerCase(),
136-
orig = {
137-
innerWidth: $.fn.innerWidth,
138-
innerHeight: $.fn.innerHeight,
139-
outerWidth: $.fn.outerWidth,
140-
outerHeight: $.fn.outerHeight
141-
};
142-
143-
function reduce( elem, size, border, margin ) {
144-
$.each( side, function() {
145-
size -= parseFloat( $.css( elem, "padding" + this ) ) || 0;
146-
if ( border ) {
147-
size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0;
148-
}
149-
if ( margin ) {
150-
size -= parseFloat( $.css( elem, "margin" + this ) ) || 0;
151-
}
152-
});
153-
return size;
154-
}
155-
156-
$.fn[ "inner" + name ] = function( size ) {
157-
if ( size === undefined ) {
158-
return orig[ "inner" + name ].call( this );
159-
}
160-
161-
return this.each(function() {
162-
$( this ).css( type, reduce( this, size ) + "px" );
163-
});
164-
};
165-
166-
$.fn[ "outer" + name] = function( size, margin ) {
167-
if ( typeof size !== "number" ) {
168-
return orig[ "outer" + name ].call( this, size );
169-
}
170-
171-
return this.each(function() {
172-
$( this).css( type, reduce( this, size, true, margin ) + "px" );
173-
});
174-
};
175-
});
176-
}
177-
178131
// selectors
179132
function focusable( element, isTabIndexNotNaN ) {
180133
var map, mapName, img,
@@ -230,6 +183,53 @@ $.extend( $.expr[ ":" ], {
230183
// support
231184
$.support.selectstart = "onselectstart" in document.createElement( "div" );
232185

186+
// support: jQuery <1.8
187+
if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
188+
$.each( [ "Width", "Height" ], function( i, name ) {
189+
var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
190+
type = name.toLowerCase(),
191+
orig = {
192+
innerWidth: $.fn.innerWidth,
193+
innerHeight: $.fn.innerHeight,
194+
outerWidth: $.fn.outerWidth,
195+
outerHeight: $.fn.outerHeight
196+
};
197+
198+
function reduce( elem, size, border, margin ) {
199+
$.each( side, function() {
200+
size -= parseFloat( $.css( elem, "padding" + this ) ) || 0;
201+
if ( border ) {
202+
size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0;
203+
}
204+
if ( margin ) {
205+
size -= parseFloat( $.css( elem, "margin" + this ) ) || 0;
206+
}
207+
});
208+
return size;
209+
}
210+
211+
$.fn[ "inner" + name ] = function( size ) {
212+
if ( size === undefined ) {
213+
return orig[ "inner" + name ].call( this );
214+
}
215+
216+
return this.each(function() {
217+
$( this ).css( type, reduce( this, size ) + "px" );
218+
});
219+
};
220+
221+
$.fn[ "outer" + name] = function( size, margin ) {
222+
if ( typeof size !== "number" ) {
223+
return orig[ "outer" + name ].call( this, size );
224+
}
225+
226+
return this.each(function() {
227+
$( this).css( type, reduce( this, size, true, margin ) + "px" );
228+
});
229+
};
230+
});
231+
}
232+
233233

234234

235235

0 commit comments

Comments
 (0)