Nessuna descrizione

new.js 900B

123456789101112131415161718192021222324252627282930313233343536
  1. ;
  2. spa_define(function() {
  3. return $.use(["spa","form","code"], function(spa,fb,code) {
  4. return {
  5. modal: function(data) {
  6. var root = spa.findInModal(".sys_role_new");
  7. var form = fb.build(root.find(".newForm"));
  8. var cr = code.parseCode(root.find(".right-ctn"));
  9. root.find(".modal-ctrl .icon-times").on("click", function() {
  10. spa.closeModal();
  11. });
  12. root.on("click",".icon-st-check",function(){
  13. $(this).toggleClass("checked");
  14. });
  15. cr.val(data.data);
  16. root.find(".opt-save").on("click",function(){
  17. var ret =[];
  18. root.find(".right-ctn i.checked").each(function(){
  19. ret.push($(this).attr("right"));
  20. });
  21. form.val({"auths":ret});
  22. form.doPost("../ajax/sys/role",function(){
  23. spa.closeModal();
  24. if(data.hand){
  25. data.hand();
  26. }
  27. });
  28. });
  29. }
  30. };
  31. });
  32. });