diff options
Diffstat (limited to 'bootstrap/comments/frontend/uncollapseinterface.js')
-rw-r--r-- | bootstrap/comments/frontend/uncollapseinterface.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/bootstrap/comments/frontend/uncollapseinterface.js b/bootstrap/comments/frontend/uncollapseinterface.js new file mode 100644 index 0000000..7d90b3a --- /dev/null +++ b/bootstrap/comments/frontend/uncollapseinterface.js @@ -0,0 +1,37 @@ +// Uncollapses the user interface (uncollapseinterface.js) +HashOver.prototype.uncollapseInterface = function (callback) +{ + // Elements to unhide + var uncollapseIDs = [ 'form-section', 'comments-section', 'end-links' ]; + + // Check if the uncollapse interface link exists + this.elements.exists ('uncollapse-interface-link', function (uncollapseLink) { + // If so, add class to hide the uncollapse interface hyperlink + hashover.classes.add (uncollapseLink, 'hashover-hide-more-link'); + + // Wait for the default CSS transition + setTimeout (function () { + // Remove the uncollapse interface hyperlink from page + uncollapseLink.parentNode.removeChild (uncollapseLink); + + // Show hidden form elements + for (var i = 0, il = uncollapseIDs.length; i < il; i++) { + hashover.elements.exists (uncollapseIDs[i], function (element) { + element.style.display = ''; + }); + } + + // Show popular comments section + if (hashover.setup['collapse-limit'] > 0) { + hashover.elements.exists ('popular-section', function (popularSection) { + popularSection.style.display = ''; + }); + } + + // Execute callback + if (typeof (callback) === 'function') { + callback (); + } + }, 350); + }); +}; |