lang.js 537 B

123456789101112131415161718192021222324
  1. /*
  2. * GitPHP Javascript language selector
  3. *
  4. * Changes the language as soon as it's selected,
  5. * rather than requiring a submit
  6. *
  7. * @author Christopher Han <xiphux@gmail.com>
  8. * @copyright Copyright (c) 2011 Christopher Han
  9. * @package GitPHP
  10. * @subpackage Javascript
  11. */
  12. define(["jquery"],
  13. function($) {
  14. return function(langSelContainer) {
  15. langSelContainer.find('select').change(
  16. function() {
  17. langSelContainer.find('form').submit();
  18. }
  19. );
  20. langSelContainer.find('input[type="submit"]').remove();
  21. }
  22. }
  23. );