@@ -128,53 +128,6 @@ $.fn.extend({
128
128
}
129
129
} ) ;
130
130
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
-
178
131
// selectors
179
132
function focusable ( element , isTabIndexNotNaN ) {
180
133
var map , mapName , img ,
@@ -230,6 +183,53 @@ $.extend( $.expr[ ":" ], {
230
183
// support
231
184
$ . support . selectstart = "onselectstart" in document . createElement ( "div" ) ;
232
185
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
+
233
233
234
234
235
235
0 commit comments