summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Save <savetheinternet@tinyboard.org>2012-03-31 19:51:25 +1100
committerMichael Save <savetheinternet@tinyboard.org>2012-03-31 19:51:25 +1100
commitb3ae75ed141bff95d97f996eab9a802acd7b2d92 (patch)
treead8497d6a4666b508095d6883e851b6f09165cdc
parentf444fa3b6e272a199f62ac1093db251488a1e2c3 (diff)
smartphone-spoiler.js: don't use jQuery
-rw-r--r--js/smartphone-spoiler.js21
1 files changed, 8 insertions, 13 deletions
diff --git a/js/smartphone-spoiler.js b/js/smartphone-spoiler.js
index fbe5bafd..262215c8 100644
--- a/js/smartphone-spoiler.js
+++ b/js/smartphone-spoiler.js
@@ -10,19 +10,14 @@
*
*/
-$(document).ready(function(){
- /* This needs to be expanded upon: */
- var is_mobile = navigator.userAgent.match(/iPhone|iPod|iPad|Android/i);
-
- if(is_mobile) {
- $('span.spoiler').each(function() {
- $(this).click(function() {
- if($(this).hasClass('show'))
- $(this).css('color', 'black').removeClass('show');
- else
- $(this).css('color', 'white').addClass('show');
- });
- });
+onready(function(){
+ if(navigator.userAgent.match(/iPhone|iPod|iPad|Android/i)) {
+ var spoilers = document.getElementsByClassName('spoiler');
+ for(var i = 0; i < spoilers.length; i++) {
+ spoilers[i].onmousedown = function() {
+ this.style.color = 'white';
+ };
+ }
}
});