Advertisement
Guest User

change.js

a guest
Jun 20th, 2016
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. $(function(){
  2. $.contextMenu({
  3. selector: '.context-menu-one',
  4.  
  5. items: {
  6. "block": {
  7. name: "Lock",
  8. icon: "edit",
  9. callback: function(key, options){
  10. var m = $(this).text();
  11. var set = block(m, $(this)); // passando - this - como parâmetro de função
  12.  
  13.  
  14. }
  15. },
  16. "sep1": "----------",
  17. "unblock": {
  18. name: "Unlock",
  19. icon: "cut",
  20. callback: function(key, options){
  21. var m = $(this).text();
  22. var set = unblock(m, $(this)); // passando - this - como parâmetro de função
  23.  
  24. }
  25. }
  26. }
  27. });
  28. });
  29.  
  30. function block(x, thisObj)
  31. {
  32. if (x === "false")
  33. x = "true";
  34.  
  35. thisObj.html(x);
  36. $(".lock1").html('<i class="fa fa-unlock" aria-hidden="true"></i>');
  37. }
  38.  
  39. function unblock(x, thisObj)
  40. {
  41. if (x === "true")
  42. x = "false";
  43.  
  44. thisObj.html(x);
  45. $(".lock1").html('<i class="fa fa-lock" aria-hidden="true"></i>');
  46.  
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement