Skip to content

Instantly share code, notes, and snippets.

@adjohu
Created October 18, 2012 17:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adjohu/3913410 to your computer and use it in GitHub Desktop.
Save adjohu/3913410 to your computer and use it in GitHub Desktop.
updateOpenTagState
(function () {
var isObject = function (foo) {
return foo.constructor == Object;
};
var mixin = function (a, b) {
for (var property in b) {
if (b.hasOwnProperty(property)) {
if (isObject(b[property])) {
if (a.hasOwnProperty(property)) {
mixin(a[property], b[property]);
continue;
}
}
a[property] = b[property];
}
}
return a;
};
window.otUpdateListeners = window.otUpdateListeners || [];
window.updateOpenTagState = function (uv) {
window.universal_variable = window.universal_variable || {};
window.prev_universal_variable = window.universal_variable;
mixin(window.universal_variable, uv);
window._qtd.push({resendUniversalVariables: 1});
for (var i = 0, ii = window.otUpdateListeners.length; i < ii; i++) {
var l = otUpdateListeners[i];
l(true);
}
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment