ay-accordion
Advanced tools
Comparing version 1.2.3 to 1.2.4
@@ -248,22 +248,30 @@ /*! Copyright (c) 2016 Ayogo Health Inc. | ||
}; | ||
var attributeCallback = function (el) { | ||
if (el.hasAttribute('ay-accordion-header') || el.querySelector('[ay-accordion-header]')) { | ||
return; | ||
} | ||
// Open if "open" is either truthy or set to an empty string | ||
var isOpen = $element[0].hasAttribute('open') && (!!$element[0].getAttribute('open') || $element[0].getAttribute('open') === ''); | ||
if (isOpen && !$element.hasClass('open')) { | ||
selfCtrl.open(); | ||
} | ||
else if (!isOpen && $element.hasClass('open')) { | ||
selfCtrl.close(); | ||
} | ||
}; | ||
Array.prototype.forEach.call($element.children(), childCallback); | ||
if ('MutationObserver' in window) { | ||
var observer = new MutationObserver(function () { | ||
var childObserver = new MutationObserver(function () { | ||
Array.prototype.forEach.call($element.children(), childCallback); | ||
}); | ||
observer.observe($element[0], { childList: true }); | ||
var attributeObserver = new MutationObserver(function () { | ||
Array.prototype.forEach.call($element.children(), attributeCallback); | ||
}); | ||
childObserver.observe($element[0], { childList: true }); | ||
attributeObserver.observe($element[0], { attributes: true }); | ||
$element.on('$destroy', function () { | ||
observer.disconnect(); | ||
childObserver.disconnect(); | ||
attributeObserver.disconnect(); | ||
}); | ||
} | ||
$attrs.$observe('open', function (newval) { | ||
if (newval || newval === "") { | ||
if (!$element.hasClass('open')) { | ||
selfCtrl.open(); | ||
} | ||
} | ||
else if ($element.hasClass('open')) { | ||
selfCtrl.close(); | ||
} | ||
}); | ||
} | ||
@@ -270,0 +278,0 @@ }; |
{ | ||
"name": "ay-accordion", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"copyright": "Copyright 2016 Ayogo Health Inc.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
0
52316
13
421
1