Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 17329 | Rev 17332 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 17329 Rev 17330
Línea 92... Línea 92...
92
    width: 100%;
92
    width: 100%;
93
    display: table;
93
    display: table;
94
    table-layout: fixed;
94
    table-layout: fixed;
95
}
95
}
Línea -... Línea 96...
-
 
96
 
-
 
97
/* Estilos para el autocompletado */
-
 
98
.bootstrap-autocomplete {
-
 
99
    z-index: 9999 !important;
-
 
100
    position: absolute !important;
-
 
101
    background: white !important;
-
 
102
    border: 1px solid #ccc !important;
-
 
103
    border-radius: 4px !important;
-
 
104
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
-
 
105
    max-height: 200px !important;
-
 
106
    overflow-y: auto !important;
-
 
107
    width: 100% !important;
-
 
108
}
-
 
109
 
-
 
110
.bootstrap-autocomplete li,
-
 
111
.bootstrap-autocomplete .dropdown-item {
-
 
112
    padding: 8px 12px !important;
-
 
113
    cursor: pointer !important;
-
 
114
    border-bottom: 1px solid #eee !important;
-
 
115
}
-
 
116
 
-
 
117
.bootstrap-autocomplete li:hover,
-
 
118
.bootstrap-autocomplete .dropdown-item:hover,
-
 
119
.bootstrap-autocomplete li.active,
-
 
120
.bootstrap-autocomplete .dropdown-item.active {
-
 
121
    background-color: #f8f9fa !important;
-
 
122
}
-
 
123
 
-
 
124
.bootstrap-autocomplete li:last-child,
-
 
125
.bootstrap-autocomplete .dropdown-item:last-child {
-
 
126
    border-bottom: none !important;
-
 
127
}
96
 
128
 
97
CSS;
129
CSS;
Línea 98... Línea 130...
98
$this->headStyle()->captureEnd();
130
$this->headStyle()->captureEnd();
99
 
131
 
Línea 403... Línea 435...
403
 
435
 
404
 
436
 
Línea -... Línea 437...
-
 
437
        $('body').on('click', 'button.btn-invite', function(e) {
405
        $('body').on('click', 'button.btn-invite', function(e) {
438
            e.preventDefault();
406
            e.preventDefault();
439
 
407
 
-
 
Línea 408... Línea -...
408
            $('#form-invite #user_uuid').autoComplete('clear');
-
 
409
            $('#form-invite #user_uuid_selected').val('');
-
 
410
            $('#modalInvite').modal('show');
-
 
411
            
-
 
412
            // Re-inicializar autoComplete cuando el modal se muestre
-
 
413
            $('#modalInvite').on('shown.bs.modal', function() {
-
 
414
                console.log('Modal shown, checking autoComplete...'); // Debug
-
 
415
                if (typeof $.fn.autoComplete !== 'undefined' && !$('#form-invite #user_uuid').data('autoComplete')) {
-
 
416
                    console.log('Re-initializing autoComplete in modal...'); // Debug
-
 
417
                    $('#form-invite #user_uuid').autoComplete({
440
            // Limpiar el campo antes de abrir el modal
418
                        resolver: 'custom',
-
 
419
                        minLength: 3,
-
 
420
                        noResultsText: 'LABEL_AUTOCOMPLETE_USERS_NOT_FOUND',
-
 
421
                        events: {
-
 
422
                            search: function (qry, callback) {
-
 
423
                                console.log('Searching for:', qry); // Debug
-
 
424
                                NProgress.start();
-
 
425
                                $.ajax({
-
 
426
                                    'url' : '$routeInvite',
-
 
427
                                    'method': 'get',
-
 
428
                                    'data': { 'search': qry },
-
 
429
                                    'dataType': 'json'
-
 
430
                                }).done(function (response) {
-
 
431
                                    console.log('Response:', response); // Debug
-
 
432
                                    if(response.success) {
-
 
433
                                        callback(response.data);
-
 
434
                                    } else {
-
 
435
                                        console.error('Search error:', response.data); // Debug
-
 
436
                                        $.fn.showError(response.data);
-
 
437
                                        callback([]);
-
 
438
                                    }
441
            $('#form-invite #user_uuid').val('');
439
                                }).fail(function( jqXHR, textStatus, errorThrown) {
-
 
440
                                    console.error('AJAX error:', textStatus, errorThrown); // Debug
-
 
441
                                    $.fn.showError(textStatus);
-
 
442
                                    callback([]);
-
 
443
                                }).always(function() {
-
 
444
                                    NProgress.done();
-
 
445
                                });
-
 
446
                            }
-
 
447
                        }
442
            $('#form-invite #user_uuid_selected').val('');
Línea 448... Línea 443...
448
                    });
443
            
449
                }
444
            // Abrir el modal
450
            });
445
            $('#modalInvite').modal('show');
Línea 471... Línea 466...
471
            }).always(function() {
466
            }).always(function() {
472
                NProgress.done();
467
                NProgress.done();
473
            });
468
            });
474
        });
469
        });
Línea 475... Línea 470...
475
 
470
 
476
        // Verificar que la librería autoComplete esté disponible
471
        // Inicializar autoComplete para el campo de búsqueda de usuarios
477
        setTimeout(function() {
-
 
478
            if (typeof $.fn.autoComplete !== 'undefined') {
472
        function initializeAutoComplete() {
479
                console.log('Initializing autoComplete...'); // Debug
-
 
480
                $('#form-invite #user_uuid').autoComplete({
-
 
481
                    resolver: 'custom',
-
 
482
                    minLength: 3,
-
 
483
                    noResultsText: 'LABEL_AUTOCOMPLETE_USERS_NOT_FOUND',
-
 
484
                    events: {
-
 
485
                        search: function (qry, callback) {
-
 
486
                            console.log('Searching for:', qry); // Debug
-
 
487
                            NProgress.start();
-
 
488
                            $.ajax({
-
 
489
                                'url' : '$routeInvite',
-
 
490
                                'method': 'get',
-
 
491
                                'data': { 'search': qry },
-
 
492
                                'dataType': 'json'
-
 
493
                            }).done(function (response) {
-
 
494
                                console.log('Response:', response); // Debug
-
 
495
                                if(response.success) {
-
 
496
                                    callback(response.data);
-
 
497
                                } else {
-
 
498
                                    console.error('Search error:', response.data); // Debug
-
 
499
                                    $.fn.showError(response.data);
-
 
500
                                    callback([]);
-
 
501
                                }
-
 
502
                            }).fail(function( jqXHR, textStatus, errorThrown) {
-
 
503
                                console.error('AJAX error:', textStatus, errorThrown); // Debug
-
 
504
                                $.fn.showError(textStatus);
-
 
505
                                callback([]);
-
 
506
                            }).always(function() {
-
 
507
                                NProgress.done();
-
 
508
                            });
-
 
509
                        }
-
 
510
                    }
-
 
-
 
473
            console.log('Initializing autoComplete...'); // Debug
511
                });
474
            
512
                console.log('autoComplete initialized successfully'); // Debug
-
 
513
            } else {
475
            if (typeof $.fn.autoComplete === 'undefined') {
-
 
476
                console.error('autoComplete library not loaded!');
514
                console.error('autoComplete library not loaded!');
477
                return;
-
 
478
            }
-
 
479
            
-
 
480
            // Destruir instancia anterior si existe
-
 
481
            if ($('#form-invite #user_uuid').data('autoComplete')) {
-
 
482
                $('#form-invite #user_uuid').autoComplete('clear');
-
 
483
            }
-
 
484
            
-
 
485
            $('#form-invite #user_uuid').autoComplete({
-
 
486
                resolver: 'custom',
-
 
487
                minLength: 3,
-
 
488
                noResultsText: 'LABEL_AUTOCOMPLETE_USERS_NOT_FOUND',
-
 
489
                events: {
-
 
490
                    search: function (qry, callback) {
-
 
491
                        console.log('Searching for:', qry); // Debug
-
 
492
                        NProgress.start();
-
 
493
                        $.ajax({
-
 
494
                            'url' : '$routeInvite',
-
 
495
                            'method': 'get',
-
 
496
                            'data': { 'search': qry },
-
 
497
                            'dataType': 'json'
-
 
498
                        }).done(function (response) {
-
 
499
                            console.log('Response:', response); // Debug
-
 
500
                            if(response.success) {
-
 
501
                                callback(response.data);
-
 
502
                            } else {
-
 
503
                                console.error('Search error:', response.data); // Debug
-
 
504
                                $.fn.showError(response.data);
-
 
505
                                callback([]);
-
 
506
                            }
-
 
507
                        }).fail(function( jqXHR, textStatus, errorThrown) {
-
 
508
                            console.error('AJAX error:', textStatus, errorThrown); // Debug
-
 
509
                            $.fn.showError(textStatus);
-
 
510
                            callback([]);
-
 
511
                        }).always(function() {
-
 
512
                            NProgress.done();
-
 
513
                        });
-
 
514
                    }
515
            }
515
                }
-
 
516
            });
-
 
517
            console.log('autoComplete initialized successfully'); // Debug
-
 
518
        }
-
 
519
        
-
 
520
        // Inicializar cuando el documento esté listo
Línea 516... Línea 521...
516
        }, 100);
521
        initializeAutoComplete();
-
 
522
 
517
 
523
	    $('#form-invite #user_uuid').on('autocomplete.select', function (evt, item) {
-
 
524
            console.log('Item selected:', item); // Debug
518
	    $('#form-invite #user_uuid').on('autocomplete.select', function (evt, item) {
525
            $('#form-invite #user_uuid_selected').val(item.value);
Línea 519... Línea 526...
519
            $('#form-invite #user_uuid_selected').val(item['value']);
526
            console.log('Hidden field value set to:', item.value); // Debug
520
        });
527
        });
521
 
528
 
Línea 872... Línea 879...
872
                NProgress.done();
879
                NProgress.done();
873
            });
880
            });
Línea 874... Línea 881...
874
 
881
 
Línea -... Línea 882...
-
 
882
        });
-
 
883
 
-
 
884
        // Re-inicializar autoComplete cuando el modal se muestre
-
 
885
        $('#modalInvite').on('shown.bs.modal', function() {
-
 
886
            console.log('Modal shown, re-initializing autoComplete...'); // Debug
-
 
887
            setTimeout(function() {
875
        });
888
                initializeAutoComplete();
Línea 876... Línea 889...
876
 
889
            }, 100);
877
 
890
        });
878
 
891
 
879
    });
892
    });