integration/js/home.js
author Anthony Ly <anthonyly.com@gmail.com>
Thu, 16 May 2013 12:58:48 +0200
changeset 6 547b3ddedf7f
child 8 7a5de13173b1
permissions -rw-r--r--
organisation des fichiers avancement édition
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     1
(function(){
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     2
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     3
    $(document).on('click', 'a.open-modal', function(e){
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     4
        e.preventDefault();
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     5
        var modalRemote = $(this).attr('href'),
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     6
            typeMedia = $(this).attr('data-type-media'),
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     7
            modalTitleInfo = $(this).attr('data-title'),
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     8
            titleFront;
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
     9
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    10
        switch(typeMedia){
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    11
            case 'video' : titleFront = '<i class="icon-film"></i> Vidéo - '+modalTitleInfo; break;
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    12
            case 'image' : titleFront = '<i class="icon-picture"></i> Image - '+modalTitleInfo; break;
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    13
        }
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    14
        $('#modal-template .modal-header h3').html(titleFront);
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    15
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    16
        $("#modal-template .modal-body").load(modalRemote, function() { 
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    17
            $("#modal-template").modal("show"); 
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    18
        });
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    19
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    20
    });
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    21
547b3ddedf7f organisation des fichiers
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff changeset
    22
})(jQuery);