aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/comments/api/frontends/latest/addcontrols.js
blob: b5642f1bae23361289183ac330c8973e0b31bd9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Add various events to various elements in each comment (addcontrols.js)
HashOverLatest.prototype.addControls = function (json, popular)
{
	// Reference to this object
	var hashover = this;

	// Get permalink from JSON object
	var permalink = json.permalink;

	// Set onclick functions for external images
	if (this.setup['allows-images'] !== false) {
		// Get embedded image elements
		var embeddedImgs = document.getElementsByClassName ('hashover-embedded-image');

		for (var i = 0, il = embeddedImgs.length; i < il; i++) {
			embeddedImgs[i].onclick = function ()
			{
				hashover.openEmbeddedImage (this);
			};
		}
	}
};