Created
September 13, 2012 22:41
-
-
Save zixaphir/3718254 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
$.on $('a.delete', div), 'click', -> | |
container = @.parentElement.parentElement | |
unless container.previousSibling or container.nextSibling | |
alert "Cannot delete theme (No other themes available)." | |
return | |
if container.id == Conf['theme'] | |
if settheme = container.previousSibling | |
$.addClass settheme, 'selectedtheme' | |
$.set 'theme', settheme.id | |
Conf['theme'] = settheme.id | |
else if settheme = container.nextSibling | |
$.addClass settheme, 'selectedtheme' | |
$.set 'theme', settheme.id | |
Conf['theme'] = settheme.id | |
userThemes[container.id]["Deleted"] = true | |
$.set 'userThemes', userThemes | |
$.rm container |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment