| 1 |
/* Dashboard Widgets Suite - Admin JavaScript */ |
| 2 |
|
| 3 |
jQuery(document).ready(function($) { |
| 4 |
|
| 5 |
$('.reset-options').on('click', function(e) { |
| 6 |
e.preventDefault(); |
| 7 |
$('.modal-dialog').dialog('destroy'); |
| 8 |
var link = this; |
| 9 |
var button_names = {} |
| 10 |
button_names[theme_switcha_settings.reset_true] = function() { window.location = link.href; } |
| 11 |
button_names[theme_switcha_settings.reset_false] = function() { $(this).dialog('close'); } |
| 12 |
$('<div class="modal-dialog">'+ theme_switcha_settings.reset_message +'</div>').dialog({ |
| 13 |
title: theme_switcha_settings.reset_title, |
| 14 |
buttons: button_names, |
| 15 |
modal: true, |
| 16 |
width: 350, |
| 17 |
closeText: '' |
| 18 |
}); |
| 19 |
}); |
| 20 |
|
| 21 |
$('.theme-screenshot').on('click', function() { |
| 22 |
if ($(this).hasClass('enable-plugin')) { |
| 23 |
$('.theme-screenshot').removeClass('theme-active'); |
| 24 |
var switched = $(this).data('switched'); |
| 25 |
$('.theme-switcha-status-switched span').text(switched); |
| 26 |
$(this).addClass('theme-active'); |
| 27 |
if ($(this).hasClass('enable-admin')) { |
| 28 |
$(this).append($('.theme-screenshot').find('.theme-admin')); |
| 29 |
} |
| 30 |
} |
| 31 |
}); |
| 32 |
|
| 33 |
}); |