Created
December 6, 2014 20:20
-
-
Save hayduke19us/147d60ec129c5833fce0 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
| $(document).on("click", "#menu", -> | |
| $( '.off-canvas-wrap' ).foundation('offcanvas', 'show', 'move-right'); | |
| false | |
| ) | |
| $(document).foundation({ | |
| offcanvas : { | |
| open_method : 'move', | |
| close_on_click : true | |
| } | |
| }); | |
| $(document).ready( -> | |
| $( '.off-canvas-wrap' ).foundation('offcanvas', 'show', 'move-right'); | |
| ) | |
| $( document ).on("click", "#delete-entity-check", -> | |
| $( "#delete-entity-check-wrapper" ).toggle("hide"); | |
| $( "#delete-entity-wrapper" ).toggle("show"); | |
| false | |
| ) | |
| $( document ).on("click", "a.choice", -> | |
| $( "a.choice").attr( "class", "choice button tiny") | |
| $( this ).attr( "class", "choice button tiny disabled") | |
| $( "#type-field" ).attr( "value", this.id ) | |
| false | |
| ) | |
| $( document ).on( "click", "a.open-tag", -> | |
| $( "#tagModal" ).foundation( 'reveal', 'open' ) | |
| $( "#observe-field" ).attr( "value", this.id ) | |
| false | |
| ) | |
| $( document ).on( "click", "#help-link", -> | |
| $("#helpModal").foundation('reveal', 'open'); | |
| false | |
| ) | |
| $( document ).on( "click", "a.adminImage", -> | |
| $( "#adminImageModal" ).foundation( 'reveal', 'open' ); | |
| action = "/fields/" + this.id + "/add_image" | |
| $( ".imageForm" ).attr( "action", action) | |
| false | |
| ) | |
| $( document ).on( "click", "a.openAdminReports", -> | |
| reportId = '#' + 'reportsBox-' + this.id | |
| imageId = '#' + 'imageBox-' + this.id | |
| tagId = '#' + 'tagsBox-' + this.id | |
| $( reportId ).toggle( 'show' ) | |
| false | |
| ) | |
| $( document ).on( "click", "a.openAdminTags", -> | |
| reportId = '#' + 'reportsBox-' + this.id | |
| imageId = '#' + 'imageBox-' + this.id | |
| tagId = '#' + 'tagsBox-' + this.id | |
| $( tagId ).toggle( 'show' ) | |
| false | |
| ) | |
| actionEffect = (originalClass, message=".actionMessage") -> | |
| $( document ).on( 'click', message, -> | |
| receiverId = '#' + this.id + 'Received' | |
| if $( receiverId ).hasClass( "actionReceiver" ) | |
| $( receiverId ).fadeOut() | |
| $( receiverId ).attr( 'class', originalClass ) | |
| return false | |
| if $( ".actionReceiver" ).length | |
| $( ".actionReceiver" ).fadeOut( -> | |
| $( receiverId ).hasClass( "actionReceiver" ); | |
| $( ".actionReceiver" ).attr( "class", originalClass ) | |
| $( receiverId ).fadeIn() | |
| $( receiverId ).attr( "class", originalClass + " actionReceiver") | |
| ); | |
| else | |
| $( receiverId ).fadeIn() | |
| $( receiverId ).attr( "class", originalClass + " actionReceiver") | |
| false | |
| ); | |
| actionEffect( "bottom-pad hide") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment