No changes
This commit is contained in:
parent
8680a02b13
commit
b6b398f5bf
17374 changed files with 2475441 additions and 0 deletions
52
ControlPanel/modules/tickets/js/rating.js
Normal file
52
ControlPanel/modules/tickets/js/rating.js
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
$(function() {
|
||||
$(".rateResponse").each(function(){
|
||||
var tid = this.getAttribute('data-tid');
|
||||
var uid = this.getAttribute('data-uid');
|
||||
var reply_id = this.getAttribute('data-reply-id');
|
||||
var rating = this.getAttribute('data-rating');
|
||||
|
||||
var inputs = "";
|
||||
|
||||
for (x = 5; x > 0; --x) {
|
||||
inputs += "<input class='star star-" + x + "' value='" + x + "' data-tid='" + tid + "' data-uid='" + uid + "' id='reply_" + reply_id + " star-" + x + "' type='radio' name='star'" + (x == rating ? " checked" : "") + ">",
|
||||
inputs += "<label class='star star-" + x + "' for='reply_" + reply_id + " star-" + x + "'></label>"
|
||||
}
|
||||
|
||||
this.$html = $([
|
||||
"<div class='stars'>",
|
||||
" <form action=''>",
|
||||
inputs,
|
||||
" </form>",
|
||||
"</div>"
|
||||
].join("\n"));
|
||||
|
||||
$(this).html(this.$html.html());
|
||||
});
|
||||
|
||||
$(".ticket_reply_notice").click(function() {
|
||||
var state = ($("#toggleNoticeIcon").text() == "+" ? "-" : "+");
|
||||
$(".ticket_ReplyBox").slideToggle(function() {
|
||||
$("#toggleNoticeIcon").text(state);
|
||||
});
|
||||
});
|
||||
|
||||
$("input[name=star]").click(function() {
|
||||
var data = {
|
||||
reply_id: this.getAttribute('id').split(/[ ,]+/)[0].replace(/\D/g, ''),
|
||||
tid: this.getAttribute('data-tid'),
|
||||
uid: this.getAttribute('data-uid'),
|
||||
rating: this.getAttribute('value')
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "home.php?m=tickets&p=rate&type=cleared&data_type=json",
|
||||
data: data,
|
||||
success: function(data) {
|
||||
console.log(data.message);
|
||||
},
|
||||
|
||||
dataType: "json",
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue