Advertisement
theo_manta

Untitled

Dec 28th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
REG 1.29 KB | None | 0 0
  1. function createItem(item, pos) {
  2.             var times = "";
  3.             for (var i = 0; i < item.slots; i++) {
  4.                 times += '<span class="time">00:00</span>';
  5.             }
  6.             $('#selectable').append('<div class="client slot' + item.slots + ' ' + item.clientcss + '" style="color:' +
  7.                 item.labelcolor +
  8.                 ';top:0;left:0;background-color:' + item.color + '" id="' +
  9.                 item.id +
  10.                 '" class="ui-widget-content"><div class="rect"></div><span class="client-name free ' + item.clientcss +
  11.                 '">' + item.name +
  12.                 '</span>' + times + '</div>')
  13.             if (admin == true) {
  14.                 $('#' + item.id).on('contextmenu', function (e) {
  15.                     openItemMenu(e, item.id);
  16.                 });
  17.                 removeItemFromAddList(item.id);
  18.             } else {
  19.                 $('#' + item.id).on('contextmenu', function (e) {
  20.                     console.log('client_right_click=' + item.id + '=' + e.pageX + '=' + e.pageY);
  21.                     stopEvent(e);
  22.                 });
  23.                 $('#' + item.id).on('click', function (e) {
  24.                     console.log('client_left_click=' + item.id);
  25.                     stopEvent(e);
  26.                 });
  27.             }
  28.  
  29.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement