Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 11
Línea 89... Línea 89...
89
     * This can be used to generate unique values for the modals.
89
     * This can be used to generate unique values for the modals.
90
     */
90
     */
91
    static modalCounter = 0;
91
    static modalCounter = 0;
Línea 92... Línea 92...
92
 
92
 
-
 
93
    /**
-
 
94
     * Getter method for .root element.
-
 
95
     * @return {object} jQuery object
-
 
96
     */
-
 
97
    get root() {
-
 
98
        return $(this._root.filter(SELECTORS.CONTAINER));
-
 
99
    }
-
 
100
 
-
 
101
    /**
-
 
102
     * Setter method for .root element.
-
 
103
     * @param {object} root jQuery object
-
 
104
     */
-
 
105
    set root(root) {
-
 
106
        this._root = root;
-
 
107
    }
-
 
108
 
93
    /**
109
    /**
94
     * Constructor for the Modal.
110
     * Constructor for the Modal.
95
     *
111
     *
96
     * @param {HTMLElement} root The HTMLElement at the root of the Modal content
112
     * @param {HTMLElement} root The HTMLElement at the root of the Modal content
97
     */
113
     */
Línea 275... Línea 291...
275
     * javascript that has been cached until now.
291
     * javascript that has been cached until now.
276
     *
292
     *
277
     * @method attachToDOM
293
     * @method attachToDOM
278
     */
294
     */
279
    attachToDOM() {
295
    attachToDOM() {
280
        this.getAttachmentPoint().append(this.root);
296
        this.getAttachmentPoint().append(this._root);
Línea 281... Línea 297...
281
 
297
 
282
        if (this.isAttached) {
298
        if (this.isAttached) {
283
            return;
299
            return;
Línea 923... Línea 939...
923
            // Ensure the modal is moved onto the body node if it is still attached to the DOM.
939
            // Ensure the modal is moved onto the body node if it is still attached to the DOM.
924
            if ($(document.body).find(this.getRoot()).length) {
940
            if ($(document.body).find(this.getRoot()).length) {
925
                $(document.body).append(this.getRoot());
941
                $(document.body).append(this.getRoot());
926
            }
942
            }
Línea -... Línea 943...
-
 
943
 
-
 
944
            // Closes popover elements that are inside the modal at the time the modal is closed.
-
 
945
            this.getRoot().find('[data-toggle="popover"]').each(function() {
-
 
946
                document.getElementById(this.getAttribute('aria-describedby'))?.remove();
-
 
947
            });
927
 
948
 
928
            this.root.trigger(ModalEvents.hidden, this);
949
            this.root.trigger(ModalEvents.hidden, this);
929
        });
950
        });
Línea 930... Línea 951...
930
    }
951
    }