Skip to content

Commit

Permalink
Протезы для ИЕ11
Browse files Browse the repository at this point in the history
  • Loading branch information
Ser-Gen committed Jun 22, 2016
1 parent 8181631 commit 62f8529
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions paste.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
var Paste = (function () {

// протез для удаления узла
if (!('remove' in Element.prototype)) {
Element.prototype.remove = function() {
if (this.parentNode) {
this.parentNode.removeChild(this);
};
};
};

// протез для нестандартных событий
(function () {
if ( typeof window.CustomEvent === "function" ) return false;

function CustomEvent ( event, params ) {
params = params || { bubbles: false, cancelable: false, detail: undefined };
var evt = document.createEvent( 'CustomEvent' );
evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail );
return evt;
};

CustomEvent.prototype = window.Event.prototype;
window.CustomEvent = CustomEvent;
})();

// создание ловушки для вставляемых данных
var createHiddenEditable = function () {
var elem = document.createElement('div');
Expand Down

0 comments on commit 62f8529

Please sign in to comment.