diff --git a/isso/js/app/dom.js b/isso/js/app/dom.js index ee1fbe8..7cf580f 100644 --- a/isso/js/app/dom.js +++ b/isso/js/app/dom.js @@ -64,6 +64,15 @@ define(function() { }); }; + window.Element.prototype.detach = function() { + /* + Detach an element from the DOM and return it. + */ + + this.parentNode.removeChild(this); + return this; + }; + window.Element.prototype.remove = function() { // Mimimi, I am IE and I am so retarded, mimimi. this.parentNode.removeChild(this); diff --git a/isso/js/app/isso.js b/isso/js/app/isso.js index 3fab8fd..6d44cb0 100644 --- a/isso/js/app/isso.js +++ b/isso/js/app/isso.js @@ -245,6 +245,19 @@ define(["behave", "app/text/html", "app/dom", "app/utils", "app/api", "app/marku clear("a.edit"); clear("a.delete"); + + // show direct reply to own comment when cookie is max aged + var show = function(el) { + if (utils.cookie(comment.id)) { + setTimeout(function() { show(el); }, 15*1000); + } else { + footer.append(el); + } + }; + + if (utils.cookie(comment.id)) { + show($("a.reply", footer).detach()); + } }; return {