Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: head.html

Issue 5119431676002304: Issue 1128 - Added ADC as supporter to Manifesto page (Closed)
Patch Set: Created Aug. 16, 2014, 8:44 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « body.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: head.html
===================================================================
--- a/head.html
+++ b/head.html
@@ -219,7 +219,8 @@
margin-top: 6px;
}
-#join-org strong
+#join-org strong,
+#supporters-more-link
{
font-weight: normal;
font-size: 15px;
@@ -227,6 +228,11 @@
text-decoration: underline;
}
+#supporters-more
+{
+ margin-bottom: 20px;
+}
+
#social button
{
width: 100%;
@@ -483,11 +489,16 @@
signeesCount.innerText = count;
}
-function addListener(obj, type, listener, useCapture)
+function addListener(obj, type, listener, useCapture, preventDefault)
{
if ("addEventListener" in obj)
{
- obj.addEventListener(type, listener, useCapture);
+ obj.addEventListener(type, function(ev)
+ {
+ listener(ev);
+ if (preventDefault)
+ ev.preventDefault();
Wladimir Palant 2014/08/18 12:31:19 A more consistent approach would be using the retu
Thomas Greiner 2014/08/19 09:32:34 Done.
+ }, useCapture);
}
else
{
@@ -497,6 +508,7 @@
obj.attachEvent("on" + type, function()
{
listener(event);
+ event.returnValue = preventDefault;
Wladimir Palant 2014/08/18 12:31:19 This should assign !preventDefault - see onclick="
Thomas Greiner 2014/08/19 09:32:34 Done.
});
}
}
@@ -504,6 +516,14 @@
addListener(window, "DOMContentLoaded", function(ev)
{
fetchNumberOfSignees();
+
+ var moreSupporters = document.getElementById("supporters-more-link");
+ addListener(moreSupporters, "click", function(ev)
+ {
+ var overflow = document.getElementById("supporters-overflow");
+ overflow.removeAttribute("hidden");
+ moreSupporters.parentNode.removeChild(moreSupporters);
+ }, false, true);
var readmore = document.getElementById("readmore");
addListener(readmore, "click", function(ev)
@@ -514,9 +534,9 @@
else
fulltext.hidden = "hidden";
- ev.preventDefault();
- ev.stopPropagation();
- }, false);
+ if ("stopPropagation" in ev)
+ ev.stopPropagation();
+ }, false, true);
var shareTitle = document.getElementById("share-text-title")[textAttr];
var shareDescription = document.getElementById("share-text-description")[textAttr];
@@ -530,7 +550,7 @@
twitterButton.href = "https://twitter.com/intent/tweet?text="
+ encodeURIComponent(shareTitle)
+ "&url=http%3A%2F%2Facceptableads.org%2F";
-}, false);
+}, false, false);
function checkCollapse()
{
@@ -562,6 +582,6 @@
}
}
-addListener(window, "scroll", checkCollapse);
-addListener(window, "resize", checkCollapse);
+addListener(window, "scroll", checkCollapse, false, false);
+addListener(window, "resize", checkCollapse, false, false);
--></script>
« no previous file with comments | « body.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld