Révision b4adf10d
Ajouté par Assos Assos il y a plus de 9 ans
drupal7/misc/ajax.js | ||
---|---|---|
618 | 618 |
.filter(':odd').addClass('even'); |
619 | 619 |
}, |
620 | 620 |
|
621 |
/** |
|
622 |
* Command to add css. |
|
623 |
* |
|
624 |
* Uses the proprietary addImport method if available as browsers which |
|
625 |
* support that method ignore @import statements in dynamically added |
|
626 |
* stylesheets. |
|
627 |
*/ |
|
628 |
add_css: function (ajax, response, status) { |
|
629 |
// Add the styles in the normal way. |
|
630 |
$('head').prepend(response.data); |
|
631 |
// Add imports in the styles using the addImport method if available. |
|
632 |
var match, importMatch = /^@import url\("(.*)"\);$/igm; |
|
633 |
if (document.styleSheets[0].addImport && importMatch.test(response.data)) { |
|
634 |
importMatch.lastIndex = 0; |
|
635 |
while (match = importMatch.exec(response.data)) { |
|
636 |
document.styleSheets[0].addImport(match[1]); |
|
637 |
} |
|
638 |
} |
|
639 |
}, |
|
640 |
|
|
621 | 641 |
/** |
622 | 642 |
* Command to update a form's build ID. |
623 | 643 |
*/ |
Formats disponibles : Unified diff
Udpate to 7.33