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

@@ -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();
});
});