UNPKG

trc-client-core

Version:
37 lines (29 loc) 825 B
/* [DEPRECATED] Hacks All Hacks are called through the wrapper. This allows us to test for rubbish browsers before we waste their time. */ var $ = require('jquery'); var DeviceMixin = require('./DeviceMixin'); var HackMixin = { bodyClassFlash: function () { if (DeviceMixin.browser === 'MSIE') { $('body').addClass('x').removeClass('x'); } }, iconRefresh: function () { var $style; $style = $('<style type="text/css">:before,:after{content:none !important}</style>'); $('head').append($style); return setTimeout(function() { return $style.remove(); }, 0); }, getHack: function (hack) { if (DeviceMixin.browser === 'MSIE') { return HackMixin[hack](); } } }; module.exports = HackMixin;