Guest User

Untitled

a guest
May 25th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. Prototype._original_property = window.Sizzle;
  2. //= require "sizzle"
  3.  
  4. (function(engine) {
  5. function extend(elements) {
  6. for (var i = 0, length = elements.length; i < length; i++) {
  7. Element.extend(elements[i]);
  8. }
  9. return elements;
  10. }
  11.  
  12. function select(selector, scope) {
  13. return extend(engine(selector, scope || document));
  14. }
  15.  
  16. function match(element, selector) {
  17. return engine.matches(selector, [element]).length == 1;
  18. }
  19.  
  20. Prototype.Selector.engine = engine;
  21. Prototype.Selector.select = select;
  22. Prototype.Selector.match = match;
  23. })(Sizzle);
  24.  
  25. // Restore globals.
  26. window.Sizzle = Prototype._original_property;
  27. delete Prototype._original_property;
Add Comment
Please, Sign In to add comment