ay-accordion
Advanced tools
Comparing version 1.2.4 to 1.3.0
@@ -182,2 +182,3 @@ /*! Copyright (c) 2016 Ayogo Health Inc. | ||
self.isOpen = false; | ||
self.isDisabled = false; | ||
self.open = function () { | ||
@@ -238,2 +239,3 @@ $element.addClass('open'); | ||
selfCtrl.rootCtrl = rootCtrl; | ||
selfCtrl.isDisabled = $element[0].hasAttribute('disabled'); | ||
var childCallback = function (el) { | ||
@@ -256,2 +258,3 @@ if (el.hasAttribute('ay-accordion-header') || el.querySelector('[ay-accordion-header]')) { | ||
var isOpen = $element[0].hasAttribute('open') && (!!$element[0].getAttribute('open') || $element[0].getAttribute('open') === ''); | ||
selfCtrl.isDisabled = $element[0].hasAttribute('disabled'); | ||
if (isOpen && !$element.hasClass('open')) { | ||
@@ -299,7 +302,17 @@ selfCtrl.open(); | ||
$scope.$watch(function () { return $ctrl.isOpen; }, function () { return updateState(); }); | ||
$scope.$watch(function () { return $ctrl.isDisabled; }, function (newval, oldval) { | ||
if (newval) { | ||
$element[0].setAttribute('aria-disabled', 'true'); | ||
} | ||
else if (oldval) { | ||
$element[0].removeAttribute('aria-disabled'); | ||
} | ||
}); | ||
$element.on('click', function ($event) { | ||
return activate($event); | ||
if (!$ctrl.isDisabled) { | ||
return activate($event); | ||
} | ||
}); | ||
$element.on('keydown', function ($event) { | ||
if ($event['repeat']) { | ||
if ($ctrl.isDisabled || $event['repeat']) { | ||
return; | ||
@@ -306,0 +319,0 @@ } |
{ | ||
"name": "ay-accordion", | ||
"version": "1.2.4", | ||
"version": "1.3.0", | ||
"copyright": "Copyright 2016 Ayogo Health Inc.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
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
62375
14
570
0