Fine-tune event format scripts

This commit is contained in:
Brian Miyaji
2014-09-05 17:38:17 +10:00
parent 426fc48c11
commit 83f798b703

View File

@@ -416,10 +416,12 @@ jQuery(document).ready(function($){
// Event format affects data // Event format affects data
$(".post-type-sp_event #post-formats-select input.post-format").change(function() { $(".post-type-sp_event #post-formats-select input.post-format").change(function() {
layout = $(".post-type-sp_event #post-formats-select input:checked").val(); layout = $(".post-type-sp_event #post-formats-select input:checked").val();
if ( layout == "friendly" ) { if ( layout == "league" ) {
$(".sp-event-league-field").hide(); $(".sp-event-sp_league-field").show().find("select").prop("disabled", false);
} else { $(".sp-event-sp_season-field").show().find("select").prop("disabled", false);
$(".sp-event-league-field").show(); } else if ( layout == "friendly" ) {
$(".sp-event-sp_league-field").hide().find("select").prop("disabled", true);
$(".sp-event-sp_season-field").show().find("select").prop("disabled", false);
} }
}); });
@@ -475,7 +477,7 @@ jQuery(document).ready(function($){
// Delete importer row // Delete importer row
$(".sp-import-table").on("click", ".sp-delete-row", function() { $(".sp-import-table").on("click", ".sp-delete-row", function() {
$self = $(this); $self = $(this);
$self.closest("tr").css("background-color", "#fcc").fadeOut(400, function() { $self.closest("tr").css("background-color", "#f99").fadeOut(400, function() {
$table = $self.closest(".sp-import-table"); $table = $self.closest(".sp-import-table");
$(this).remove(); $(this).remove();
$table.trigger("updatePostCount"); $table.trigger("updatePostCount");