Created
March 6, 2015 23:04
-
-
Save csarven/54b0a2a4c0694afd7593 to your computer and use it in GitHub Desktop.
This file contains 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
$('#views.lr button').on('click', function(event) { | |
var selected = $(this); | |
$('head link[rel~="stylesheet"]:not([href$="lr.css"])').each(function(i, stylesheet) { | |
if ($(this).prop('title').toLowerCase() == selected.text().toLowerCase()) { | |
var s = $('<link>').prop({type: 'text/css', rel: 'stylesheet', href: $(this).prop('href'), title: $(this).prop('title')}); | |
} | |
else { | |
var s = $('<link>').prop({type: 'text/css', rel: 'stylesheet alternate', href: $(this).prop('href'), title: $(this).prop('title')}); | |
} | |
stylesheet.parentNode.replaceChild(s.get(0), stylesheet); | |
}); | |
$('#views.lr button:disabled').removeAttr('disabled'); | |
$(this).attr('disabled', 'disabled'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment