Skip to content

Commit a3f1a34

Browse files
committed
Remove use of $.browser; add $.ui.ie and $.ui.ie6 temporarily.
1 parent fa62f21 commit a3f1a34

9 files changed

+18
-12
lines changed

tests/jquery.simulate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ $.extend( $.simulate.prototype, {
148148
}
149149

150150
// TODO: can we hook into core's logic?
151-
if ( $.browser.msie || $.browser.opera ) {
151+
if ( $.ui.ie || (({}).toString.call( window.opera ) === "[object Opera]") ) {
152152
// TODO: is charCode ever <0 ? Can we just use charCode || keyCode?
153153
event.keyCode = (options.charCode > 0) ? options.charCode : options.keyCode;
154154
event.charCode = undefined;

tests/unit/datepicker/datepicker_core.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ test('baseStructure', function() {
5959
var header, title, table, thead, week, panel, inl, child,
6060
inp = init('#inp').focus(),
6161
dp = $('#ui-datepicker-div'),
62-
iframe = ($.browser.msie && parseInt($.browser.version, 10) < 7);
62+
iframe = ($.ui.ie6);
6363
ok(dp.is(':visible'), 'Structure - datepicker visible');
6464
ok(!dp.is('.ui-datepicker-rtl'), 'Structure - not right-to-left');
6565
ok(!dp.is('.ui-datepicker-multi'), 'Structure - not multi-month');
@@ -186,7 +186,7 @@ test('customStructure', function() {
186186
inp = init('#inp', $.datepicker.regional.he);
187187
inp.data('showButtonPanel.datepicker',true);
188188
inp.focus();
189-
iframe = ($.browser.msie && parseInt($.browser.version, 10) < 7);
189+
iframe = ($.ui.ie6);
190190
ok(dp.is('.ui-datepicker-rtl'), 'Structure RTL - right-to-left');
191191
header = dp.children(':first');
192192
ok(header.is('div.ui-datepicker-header'), 'Structure RTL - header division');

ui/jquery.ui.core.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ $.fn.extend({
6969

7070
scrollParent: function() {
7171
var scrollParent;
72-
if (($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
72+
if (($.ui.ie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
7373
scrollParent = this.parents().filter(function() {
7474
return (/(relative|absolute|fixed)/).test($.css(this,'position')) && (/(auto|scroll)/).test($.css(this,'overflow')+$.css(this,'overflow-y')+$.css(this,'overflow-x'));
7575
}).eq(0);
@@ -258,6 +258,12 @@ $(function() {
258258

259259
// deprecated
260260

261+
(function() {
262+
var uaMatch = /msie ([\w.]+)/.exec( navigator.userAgent.toLowerCase() ) || [];
263+
$.ui.ie = uaMatch.length ? true : false;
264+
$.ui.ie6 = parseFloat( uaMatch[ 1 ], 10 ) === 6;
265+
})();
266+
261267
$.fn.extend({
262268
disableSelection: function() {
263269
return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) +

ui/jquery.ui.datepicker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1605,7 +1605,7 @@ $.extend(Datepicker.prototype, {
16051605
}
16061606
html += group;
16071607
}
1608-
html += buttonPanel + ($.browser.msie && parseInt($.browser.version,10) < 7 && !inst.inline ?
1608+
html += buttonPanel + ($.ui.ie6 && !inst.inline ?
16091609
'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>' : '');
16101610
inst._keyEvent = false;
16111611
return html;

ui/jquery.ui.dialog.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ $.extend( $.ui.dialog.overlay, {
768768
var scrollHeight,
769769
offsetHeight;
770770
// handle IE
771-
if ( $.browser.msie ) {
771+
if ( $.ui.ie ) {
772772
scrollHeight = Math.max(
773773
document.documentElement.scrollHeight,
774774
document.body.scrollHeight
@@ -793,7 +793,7 @@ $.extend( $.ui.dialog.overlay, {
793793
var scrollWidth,
794794
offsetWidth;
795795
// handle IE
796-
if ( $.browser.msie ) {
796+
if ( $.ui.ie ) {
797797
scrollWidth = Math.max(
798798
document.documentElement.scrollWidth,
799799
document.body.scrollWidth

ui/jquery.ui.draggable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ $.widget("ui.draggable", $.ui.mouse, {
318318
}
319319

320320
if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information
321-
|| (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix
321+
|| (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.ui.ie)) //Ugly IE fix
322322
po = { top: 0, left: 0 };
323323

324324
return {

ui/jquery.ui.mouse.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ $.widget("ui.mouse", {
111111

112112
_mouseMove: function(event) {
113113
// IE mouseup check - mouseup happened when mouse was out of window
114-
if ($.browser.msie && !(document.documentMode >= 9) && !event.button) {
114+
if ($.ui.ie && !(document.documentMode >= 9) && !event.button) {
115115
return this._mouseUp(event);
116116
}
117117

ui/jquery.ui.resizable.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,8 +466,8 @@ $.widget("ui.resizable", $.ui.mouse, {
466466
this.helper = this.helper || $('<div style="overflow:hidden;"></div>');
467467

468468
// fix ie6 offset TODO: This seems broken
469-
var ie6 = $.browser.msie && $.browser.version < 7, ie6offset = (ie6 ? 1 : 0),
470-
pxyoffset = ( ie6 ? 2 : -1 );
469+
var ie6offset = ($.ui.ie6 ? 1 : 0),
470+
pxyoffset = ( $.ui.ie6 ? 2 : -1 );
471471

472472
this.helper.addClass(this._helper).css({
473473
width: this.element.outerWidth() + pxyoffset,

ui/jquery.ui.sortable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,7 @@ $.widget("ui.sortable", $.ui.mouse, {
822822
}
823823

824824
if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information
825-
|| (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix
825+
|| (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.ui.ie)) //Ugly IE fix
826826
po = { top: 0, left: 0 };
827827

828828
return {

0 commit comments

Comments
 (0)