Last active
December 17, 2015 07:59
-
-
Save mcwhittemore/5577092 to your computer and use it in GitHub Desktop.
Expand and collapse GH detail column
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
var getColumn = function(id){ | |
var out = {}; | |
out.header = $(".ghx-column[data-id='"+id+"']"); | |
out.lane = $(".ghx-column[data-column-id='"+id+"']"); | |
return out; | |
} | |
var detailSlide = function(e){ | |
e.preventDefault(); | |
if($("#ghx-tab-details").data("resized")==undefined){ | |
$("#ghx-tab-details").data("resized", "true"); | |
$("#ghx-tab-details .ghx-tab-section").width(300).css("float", "left"); | |
} | |
var available = $("#ghx-content-main").width(); | |
var detail_min = 400; | |
var detail_max = detail_min+((available-detail_min)/2); | |
var timelapse = 500; | |
var easemethod = "swing"; | |
if($("#ghx-detail-view").width()==detail_min){ | |
var sw = available-detail_max-20; | |
$("#ghx-detail-view").animate({width:detail_max+"px"}, timelapse, easemethod); | |
$("#ghx-column-header-group").animate({width:sw+"px"}, timelapse, easemethod); | |
} | |
else{ | |
var sw = available-detail_min-20; | |
$("#ghx-detail-view").animate({width:detail_min+"px"}, timelapse, easemethod); | |
$("#ghx-column-header-group").animate({width:sw+"px"}, timelapse, easemethod); | |
} | |
} | |
var removeFinished = function(){ | |
$(".ghx-done").each(function(){ $(this).remove(); }); | |
} | |
if($("#detail_slide").length == 0){ | |
$(".aui-nav:first").append("<li class='customButton'><a id='detail_slide'>Slide Detail</a></li>"); | |
$("#detail_slide").on('click', detailSlide); | |
$(".aui-nav:first").append("<li class='customButton'><a id='remove_finished'>Remove Finished</a></li>"); | |
$("#remove_finished").on('click', removeFinished); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment