Changeset 436dcaa in sicp


Ignore:
Timestamp:
Aug 12, 2015, 9:48:53 AM (9 years ago)
Author:
Ing. Roldan D. Vargas G <rvargas@…>
Branches:
master
Children:
ca89a71
Parents:
d01ca96
Message:

agregada funcion para alinear verticalmente las ventanas modales

File:
1 edited

Legend:

Unmodified
Added
Removed
  • static/js/layout.js

    r5d55ba0 r436dcaa  
    1616*/
    1717$(document).ready(function() {
     18
     19    /** Deshabilita las acciones de enlaces con estatus disable */
     20    $("a").on("click", function(event){
     21        if ($(this).is("[disabled]")) {
     22            event.preventDefault();
     23        }
     24    });
    1825
    1926    if ($('.js-captcha-refresh').length) {
     
    190197});
    191198
     199/** Alineación vertical de las ventanas modales */
    192200$(function() {
    193         function reposition() {
    194             var modal = $(this),
    195                 dialog = modal.find('.modal-dialog');
    196             modal.css('display', 'block');
    197 
    198             // Dividing by two centers the modal exactly, but dividing by three
    199             // or four works better for larger screens.
    200             dialog.css("margin-top", Math.max(0, ($(window).height() - dialog.height()) / 2));
    201         }
    202         // Reposition when a modal is shown
    203         $('.modal').on('show.bs.modal', reposition);
    204         // Reposition when the window is resized
    205         $(window).on('resize', function() {
    206             $('.modal:visible').each(reposition);
    207         });
     201    function reposition() {
     202        var modal = $(this),
     203            dialog = modal.find('.modal-dialog');
     204
     205        modal.css('display', 'block');
     206
     207        // Dividing by two centers the modal exactly, but dividing by three
     208        // or four works better for larger screens.
     209        dialog.css("margin-top", Math.max(0, ($(window).height() - dialog.height()) / 2));
     210    }
     211
     212    // Reposition when a modal is shown
     213    $('.modal').on('show.bs.modal', reposition);
     214    // Reposition when the window is resized
     215    $(window).on('resize', function() {
     216        $('.modal:visible').each(reposition);
    208217    });
     218});
Note: See TracChangeset for help on using the changeset viewer.