aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/comments/frontend/formattingonclick.js
diff options
context:
space:
mode:
Diffstat (limited to 'bootstrap/comments/frontend/formattingonclick.js')
-rw-r--r--bootstrap/comments/frontend/formattingonclick.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/bootstrap/comments/frontend/formattingonclick.js b/bootstrap/comments/frontend/formattingonclick.js
new file mode 100644
index 0000000..b94294c
--- /dev/null
+++ b/bootstrap/comments/frontend/formattingonclick.js
@@ -0,0 +1,25 @@
+// Attach click event to formatting revealer hyperlinks (formattingonclick.js)
+HashOver.prototype.formattingOnclick = function (type, permalink)
+{
+ permalink = (permalink !== undefined) ? '-' + permalink : '';
+
+ // Reference to this object
+ var hashover = this;
+
+ // Get formatting message elements
+ var formattingID = type + '-formatting';
+ var formatting = this.elements.get (formattingID + permalink, true);
+ var formattingMessage = this.elements.get (formattingID + '-message' + permalink, true);
+
+ // Attach click event to formatting revealer hyperlink
+ formatting.onclick = function ()
+ {
+ if (hashover.classes.contains (formattingMessage, 'hashover-message-open')) {
+ hashover.messages.close (formattingMessage);
+ return false;
+ }
+
+ hashover.messages.open (formattingMessage);
+ return false;
+ }
+};