Move admin widget scripts

This commit is contained in:
Brian Miyaji
2014-04-26 17:52:05 +10:00
parent 08f13358b3
commit b6342b97e3
3 changed files with 23 additions and 15 deletions

View File

@@ -33,21 +33,6 @@ jQuery(document).ready(function($){
// Activate auto key placeholder
$("#poststuff #title").keyup();
// Orderby affects order select in widget options
$("body.widgets-php").on("change", ".sp-select-orderby", function() {
$(this).closest(".widget-content").find(".sp-select-order").prop("disabled", $(this).val() == "default");
});
// Calendar affects view all link checkbox in widget options
$("body.widgets-php").on("change", ".sp-event-calendar-select", function() {
$el = $(this).closest(".widget-content").find(".sp-event-calendar-show-all-toggle");
if($(this).val() == 0)
$el.hide();
else
$el.show();
});
// Table switcher
$(".sp-table-panel").siblings(".sp-table-bar").find("a").click(function() {
$(this).closest("li").find("a").addClass("current").closest("li").siblings().find("a").removeClass("current").closest(".sp-table-bar").siblings($(this).attr("href")).show().siblings(".sp-table-panel").hide();

View File

@@ -0,0 +1,17 @@
jQuery(document).ready(function($){
// Orderby affects order select in widget options
$("body").on("change", ".sp-select-orderby", function() {
$(this).closest(".widget-content").find(".sp-select-order").prop("disabled", $(this).val() == "default");
});
// Calendar affects view all link checkbox in widget options
$("body").on("change", ".sp-event-calendar-select", function() {
$el = $(this).closest(".widget-content").find(".sp-event-calendar-show-all-toggle");
if($(this).val() == 0)
$el.hide();
else
$el.show();
});
});