Skip to content

Instantly share code, notes, and snippets.

View abods's full-sized avatar

Abdullah alotaibi abods

View GitHub Profile
@abods
abods / fabricJS history
Created November 5, 2016 12:53 — forked from ZAYEC77/fabricJS history
History implementation for fabricJS
function (canvas, container) {
var history = {state: [], lock: true, mods: 0};
app.history = history;
canvas.on('history.lock', function () {
history.lock = true;
});
canvas.on('history.unlock', function () {
history.lock = false;
@abods
abods / detect ie
Created September 27, 2012 16:46 — forked from padolsey/gist:527683
js
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}