Skip to content

Commit

Permalink
remove $.browser
Browse files Browse the repository at this point in the history
  • Loading branch information
popomore committed May 22, 2013
1 parent c8f27d2 commit 29d7296
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/iframe-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ define(function(require, exports, module) {
var $ = require('$');
var Position = require('position');

var isIE6 = (window.navigator.userAgent || '').toLowerCase().indexOf('msie 6') !== -1;

// target 是需要添加垫片的目标元素,可以传 `DOM Element` 或 `Selector`
function Shim(target) {
Expand Down Expand Up @@ -51,7 +52,7 @@ define(function(require, exports, module) {
delete this.target;
};

if ($.browser.msie && $.browser.version === '6.0') {
if (isIE6) {
module.exports = Shim;
} else {
// 除了 IE6 都返回空函数
Expand Down
2 changes: 1 addition & 1 deletion tests/iframe-shim-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ define(function(require) {

describe('iframe-shim', function() {

var div, isIE6 = $.browser.msie && $.browser.version === '6.0';
var div, isIE6 = (window.navigator.userAgent || '').toLowerCase().indexOf('msie 6') !== -1;

beforeEach(function() {
div = $('<div></div>').appendTo(document.body);
Expand Down

0 comments on commit 29d7296

Please sign in to comment.