forked from surveywp/kk-star-ratings
-
Notifications
You must be signed in to change notification settings - Fork 0
/
js_admin.js
41 lines (30 loc) · 1.04 KB
/
js_admin.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Object bf_admin is available to use
(function($){
var bf_admin_plugin_kksr = {
init : function()
{
jQuery(document).ready( function($){
bf_admin_plugin_kksr.reset_ratings($('.bhittani-framework'), bhittani_plugin_kksr_js_admin.func_reset, bhittani_plugin_kksr_js_admin.nonce)
});
},
reset_ratings : function(obj, func, nonce)
{
$('a[rel="kksr-reset"]', obj).click( function(){
var form = jQuery('form[name="bf_form"]', obj);
var values = form.serialize();
bf_admin.ajax_post($, values, func, nonce, 'Flushing');
$('._kksr_reset._on', obj).parent().fadeOut('slow');
return false;
});
$('a[rel="kksr-reset-all"]', obj).click( function(){
$('._kksr_reset', obj).removeClass('_off').addClass('_on').val('1');
return false;
});
$('a[rel="kksr-reset-none"]', obj).click( function(){
$('._kksr_reset', obj).removeClass('_on').addClass('_off').val('0');
return false;
});
}
};
bf_admin_plugin_kksr.init();
})( jQuery );