Created
November 21, 2014 23:53
-
-
Save ZachMoreno/636d67381fce01717539 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// forEach method, could be shipped as part of an Object Literal/Module | |
var forEach = function (array, callback, scope) { | |
for (var i = 0; i < array.length; i++) { | |
callback.call(scope, i, array[i]); // passes back stuff we need | |
} | |
}; | |
// language-toggle | |
var activateEnglish = function () { | |
var allSpnElements = document.querySelectorAll("[data-spanish]"), i; | |
forEach(allSpnElements, function(index, value) { | |
jQuery(value).html(jQuery(value).data("english")); | |
}); | |
// location.reload(); | |
// jQuery("#meeting-info h1.card-header").html(jQuery("#meeting-info h1.card-header").data("english")); | |
}, | |
activateSpanish = function () { | |
var allSpnElements = document.querySelectorAll("[data-spanish]"); | |
forEach(allSpnElements, function(index, value) { | |
jQuery(value).html(jQuery(value).data("spanish")); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment