File size: 1,067 Bytes
4edb0a8
 
61e59f4
4edb0a8
61e59f4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4edb0a8
 
 
 
 
 
 
 
61e59f4
 
 
4edb0a8
61e59f4
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// New window: show and bring to top
function newWindow(element) {
    $(element).show();
    $(element).selectWindow();
}

$( function() {
    // Window drag
    $( ".window" ).draggable({ handle: "div.windowtitle" });

    // Window resize
    $( ".window" ).resizable({ handles: "all", alsoresize: ".windowinner" });

    // Window close
    $('.windowclose').on("click", function () { $(this).parents('div.window').hide(); });

    // Window click-to-bring-to-top
    (function() {
        var highest = 100;

        $.fn.selectWindow = function() {
            // Make top
            this.css('z-index', ++highest);
            // Make this window selected and others not
            this.addClass('selectedwindow');
            $('.window').not(this).each(function(){
                $(this).removeClass('selectedwindow');
             });
        };
    })();
    $('.window').click(function() {
        $(this).selectWindow();
    });

    // Icon single click
    $('.icon').click(function() {
      $(this).find('p').toggleClass('highlight');
    });
} );