Update admin js

This commit is contained in:
Brian Miyaji
2014-10-21 02:29:18 +11:00
parent 183ce65dda
commit 688c5c53d8

View File

@@ -299,6 +299,11 @@ jQuery(document).ready(function($){
axis: "y"
});
// Autosave
$(".sp-autosave").change(function() {
$(this).attr("readonly", true).closest("form").submit();
});
// Video embed
$(".sp-add-video").click(function() {
$(this).closest("fieldset").hide().siblings(".sp-video-field").show();
@@ -416,12 +421,12 @@ jQuery(document).ready(function($){
// Event format affects data
$(".post-type-sp_event #post-formats-select input.post-format").change(function() {
layout = $(".post-type-sp_event #post-formats-select input:checked").val();
if ( layout == "league" ) {
$(".sp-event-sp_league-field").show().find("select").prop("disabled", false);
$(".sp-event-sp_season-field").show().find("select").prop("disabled", false);
} else if ( layout == "friendly" ) {
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);
} else {
$(".sp-event-sp_league-field").show().find("select").prop("disabled", false);
$(".sp-event-sp_season-field").show().find("select").prop("disabled", false);
}
});