właśnie debugowania modal.js i natknąłem się na następujący fragment kodu:emulateTransitionEnd w pliku bootstrap.js, skąd się bierze?
that.$element.find('.modal-dialog') // wait for modal to slide in
.one('bsTransitionEnd', function() {
that.$element.trigger('focus').trigger(e)
})
.emulateTransitionEnd(Modal.TRANSITION_DURATION) :
that.$element.trigger('focus').trigger(e)
Moje pytanie dotyczy następującej linii:
emulateTransitionEnd(Modal.TRANSITION_DURATION) :
Co to jest? Funkcja jQuery? Niestandardowa funkcja w bootstrapie?
Przeszukałem tę funkcję, ale prawie nie mogłem jej znaleźć, domyślam się, że jest to niestandardowa funkcja ładowania początkowego. Ale nie widzę w ogóle tej funkcji w moim pliku modal.js (podzbiór bootstrap.js).
Widziałem gdzieś: link.
Co to jest emulateTransitionEnd
naprawdę? I gdzie to jest zdefiniowane i co robi?
można znaleźć linię mówię tutaj: line 99 modal.js
Straciłeś kopię grep? https://github.com/twbs/bootstrap/blob/ad379ffb4a0fde7416ae076e68141300fc583018/js/transition.js#L36 – cvrebert
@ cvrebert, ok, więc mam właśnie Jquery i modal.js i robię modal, nie mam transition.js, a mój cosnole nie pokazuje żadnych błędów! DLACZEGO ??? –
Jeśli nie załadujesz modułu przejść, wówczas ['$ .support.transition'] (https://github.com/twbs/bootstrap/blob/bcf7dd38b5ab180256e2e4fb5da0369551b3f082/js/transition.js#L46) będzie niezdefiniowane, więc [przejścia będą tylko wyłączone] (https://github.com/twbs/bootstrap/blob/442d2dd458c6283c7ecb75c6eb7cb4bcee916eab/js/modal.js#L125) – cvrebert