mirror of https://gitee.com/karson/fastadmin.git
15 lines
493 B
JavaScript
15 lines
493 B
JavaScript
// IE8 polyfill
|
|
HTMLDocument.prototype.getElementsByClassName =
|
|
Element.prototype.getElementsByClassName =
|
|
function getElementsByClassName (className) {
|
|
for (var res = [], els = this.getElementsByTagName('*'), n = els.length; n--;) {
|
|
if (els[n].className.indexOf(className) > -1) {
|
|
res.push(els[n]);
|
|
}
|
|
}
|
|
return res;
|
|
}
|
|
|
|
// prevent selection because it's annoying when dragging
|
|
document.onselectstart = function(){ return false; };
|
|
document.body.setAttribute('unselectable', 'on', 0); |