comment.js 885 B

12345678910111213141516171819202122232425
  1. define(['jquery', 'bootstrap', 'frontend', 'form'], function ($, undefined, Frontend, Form) {
  2. var Controller = {
  3. index: function () {
  4. },
  5. post: function () {
  6. $(document).on("click", ".rating-star", function (e) {
  7. var container = $(this).closest(".rating");
  8. var name = container.data("name");
  9. var value = $(this).data("value");
  10. $("span", container).removeClass("checked");
  11. $(this).addClass("checked");
  12. container.data("value", value);
  13. $("input[name='" + name + "']").val(value);
  14. });
  15. Form.api.bindevent("#postform", function (data, ret) {
  16. setTimeout(function () {
  17. location.href = ret.url;
  18. }, 1500);
  19. });
  20. }
  21. };
  22. return Controller;
  23. });