Guest User

Untitled

a guest
May 25th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. $('div.icon').dblclick(function(ev, ui) {
  2. //'+ (panels.size() + 1) +'
  3. //try setting a id to have panels be individualistic
  4. //$(this).replaceWith("<div>" + $(this).text() + "</div>");
  5.  
  6. $(this).prepend('<div class="panel flora" title="'+ $(this).find('.icontxt').text() +'"> >:) Click & drag icons, double click to open a window.</div>');
  7. $(this).find('.panel').dialog({
  8. position: ['center','center'],
  9. stack: true,
  10. open: function(ev, ui) {
  11. $('.ui-dialog-titlebar').dblclick(function(ev, ui) {
  12. var maxHeight = $('#wrapper').height(); var maxWidth = $('#wrapper').width();
  13. if (max) {
  14. $('.panel').css('top',temp[1]);
  15. $('.panel').css('left',temp[2]);
  16. $('.panel').height(temp[4]).width(temp[3]);
  17. max = false;
  18. } else {
  19. /*temp = [$(this).parent().css('top'),$(this).parent().css('left'),$(this).parent().width,$(this).parent().height];
  20. $('.panel').css('top: 0;','left: 0;');
  21. //$('.panel').css('left','0');
  22. $('.panel').height(maxHeight).width(maxWidth);
  23. $(this).parent().dialog({draggable:false});
  24. $(this).parent().parent().dialog({resizable:false});*/
  25. alert($(this).parents("div.icon").find('.panel').dialog("isOpen"));
  26.  
  27. max = true;
  28. }
  29. //$('.panel').dialog({draggable: false});
  30. });
  31. }
  32. });
  33. });
Add Comment
Please, Sign In to add comment