Created
June 4, 2013 19:59
-
-
Save Heavyblade/5709058 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
| $('.viewingtask').droppable | |
| accept: '.color-swatch' | |
| tolerance: 'touch' | |
| over: -> #when you hover over it lightens up | |
| $(this).addClass('lighten') | |
| out: -> #when you hover out it goes back to normal | |
| $(this).removeClass('lighten') | |
| greedy: true | |
| drop: (e, ui) -> | |
| if ui.helper.hasClass('color-swatch') | |
| color = $(ui.helper).data('color') | |
| classes = $(".ui-dialog-titlebar").attr "class" | |
| new_classes = classes.replace(/top-\w+(\s*|$)/g, "") + "top-" + color | |
| $(this).find(".ui-dialog-titlebar").attr("class", new_classes) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment