integration/js/common.js
changeset 174 a1656f70f1c9
parent 78 5dddae65a99a
equal deleted inserted replaced
165:b4377a741714 174:a1656f70f1c9
     1 $(function(){
     1 $(function(){
     2 
     2 
     3     $.fn.hasAttr = function(name) {  
     3     $.fn.hasAttr = function(name) {  
     4        return this.attr(name) !== undefined;
     4        return this.attr(name) !== undefined;
     5     };
     5     };
       
     6 
       
     7     $('.modal').on('show', function () {
       
     8         var halfWidth = $(this).width() / 2;
       
     9         $(this).css({
       
    10             'margin-left' : - halfWidth +'px'
       
    11         });
       
    12     });
     6 
    13 
     7 //open modal
    14 //open modal
     8     $(document).on('click', 'a.open-modal', function(e){
    15     $(document).on('click', 'a.open-modal', function(e){
     9         e.preventDefault();
    16         e.preventDefault();
    10         var modalRemote = $(this).attr('href'),
    17         var modalRemote = $(this).attr('href'),