projects
/
yaffs-website
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website]
/
web
/
themes
/
contrib
/
bootstrap
/
src
/
Utility
/
Attributes.php
diff --git
a/web/themes/contrib/bootstrap/src/Utility/Attributes.php
b/web/themes/contrib/bootstrap/src/Utility/Attributes.php
index 91bc2cb8d9b318d6c175f26fd82fc6e022e42ce0..b6032989c5db664fabd1f34b303709f9bc004fd2 100644
(file)
--- a/
web/themes/contrib/bootstrap/src/Utility/Attributes.php
+++ b/
web/themes/contrib/bootstrap/src/Utility/Attributes.php
@@
-1,8
+1,4
@@
<?php
<?php
-/**
- * @file
- * Contains \Drupal\bootstrap\Utility\Attributes.
- */
namespace Drupal\bootstrap\Utility;
namespace Drupal\bootstrap\Utility;
@@
-152,7
+148,14
@@
class Attributes extends ArrayObject {
* @see \Drupal\bootstrap\Utility\ArrayObject::offsetSet()
*/
public function setAttribute($name, $value) {
* @see \Drupal\bootstrap\Utility\ArrayObject::offsetSet()
*/
public function setAttribute($name, $value) {
- $this->offsetSet($name, $value);
+ // Handle class attribute differently.
+ if ($name === 'class') {
+ $this->removeAttribute('class');
+ $this->addClass($value);
+ }
+ else {
+ $this->offsetSet($name, $value);
+ }
}
/**
}
/**
@@
-164,6
+167,14
@@
class Attributes extends ArrayObject {
* @see \Drupal\bootstrap\Utility\ArrayObject::merge()
*/
public function setAttributes(array $values) {
* @see \Drupal\bootstrap\Utility\ArrayObject::merge()
*/
public function setAttributes(array $values) {
+ // Handle class attribute differently.
+ $classes = isset($values['class']) ? $values['class'] : [];
+ unset($values['class']);
+ if ($classes) {
+ $this->addClass($classes);
+ }
+
+ // Merge the reset of the attributes.
$this->merge($values);
}
$this->merge($values);
}