Skip to content

Instantly share code, notes, and snippets.

@Phunky
Created March 2, 2016 21:40
Show Gist options
  • Save Phunky/6c211cff32842123971c to your computer and use it in GitHub Desktop.
Save Phunky/6c211cff32842123971c to your computer and use it in GitHub Desktop.
! function(t) {
function e(r) {
if (s[r]) return s[r].exports;
var i = s[r] = {
exports: {},
id: r,
loaded: !1
};
return t[r].call(i.exports, i, i.exports, e), i.loaded = !0, i.exports
}
var s = {};
return e.m = t, e.c = s, e.p = "", e(0)
}([function(t, e) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
}), e["default"] = {
install: function(t) {
t.directive("svg", {
params: ["sprite"],
bind: function() {
var t = document.createElementNS("http://www.w3.org/2000/svg", "svg"),
e = document.createElementNS("http://www.w3.org/2000/svg", "use"),
s = "" + opts.prefix + this.params.sprite,
r = null,
i = this.el;
for (var a in i.attributes) {
var n = i.attributes[a].name;
"string" == typeof n && "_v" === n.substr(0, 2) && (r = n)
}
e.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", opts.sprites + "#" + s), e.setAttributeNS(null, r, ""), "svg" !== i.tagName && (t.setAttributeNS(null, r, ""), t.classList.add(opts["class"], s), i.appendChild(t), i = t), i.classList.add(opts["class"], s), i.appendChild(e)
}
})
}
}
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment