Skip to content

Commit 177d0f2

Browse files
committed
Core: Moved old jQuery support code to the bottom (above deprecated).
(cherry picked from commit 8a32c39)
1 parent da2fbca commit 177d0f2

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,
@@ -252,6 +205,53 @@ $(function() {
252205
body.removeChild( div ).style.display = "none";
253206
});
254207

208+
// support: jQuery <1.8
209+
if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
210+
$.each( [ "Width", "Height" ], function( i, name ) {
211+
var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
212+
type = name.toLowerCase(),
213+
orig = {
214+
innerWidth: $.fn.innerWidth,
215+
innerHeight: $.fn.innerHeight,
216+
outerWidth: $.fn.outerWidth,
217+
outerHeight: $.fn.outerHeight
218+
};
219+
220+
function reduce( elem, size, border, margin ) {
221+
$.each( side, function() {
222+
size -= parseFloat( $.css( elem, "padding" + this ) ) || 0;
223+
if ( border ) {
224+
size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0;
225+
}
226+
if ( margin ) {
227+
size -= parseFloat( $.css( elem, "margin" + this ) ) || 0;
228+
}
229+
});
230+
return size;
231+
}
232+
233+
$.fn[ "inner" + name ] = function( size ) {
234+
if ( size === undefined ) {
235+
return orig[ "inner" + name ].call( this );
236+
}
237+
238+
return this.each(function() {
239+
$( this ).css( type, reduce( this, size ) + "px" );
240+
});
241+
};
242+
243+
$.fn[ "outer" + name] = function( size, margin ) {
244+
if ( typeof size !== "number" ) {
245+
return orig[ "outer" + name ].call( this, size );
246+
}
247+
248+
return this.each(function() {
249+
$( this).css( type, reduce( this, size, true, margin ) + "px" );
250+
});
251+
};
252+
});
253+
}
254+
255255

256256

257257

0 commit comments

Comments
 (0)