Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(function(){
- $.contextMenu({
- selector: '.context-menu-one',
- items: {
- "block": {
- name: "Lock",
- icon: "edit",
- callback: function(key, options){
- var m = $(this).text();
- var set = block(m, $(this)); // passando - this - como parâmetro de função
- }
- },
- "sep1": "----------",
- "unblock": {
- name: "Unlock",
- icon: "cut",
- callback: function(key, options){
- var m = $(this).text();
- var set = unblock(m, $(this)); // passando - this - como parâmetro de função
- }
- }
- }
- });
- });
- function block(x, thisObj)
- {
- if (x === "false")
- x = "true";
- thisObj.html(x);
- $(".lock1").html('<i class="fa fa-unlock" aria-hidden="true"></i>');
- }
- function unblock(x, thisObj)
- {
- if (x === "true")
- x = "false";
- thisObj.html(x);
- $(".lock1").html('<i class="fa fa-lock" aria-hidden="true"></i>');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement