Skip to content

Commit

Permalink
fix(core/ui): return early if element is not passed
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoscaceres authored and Marcos Cáceres committed Mar 1, 2017
1 parent ad67d91 commit f02a044
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions js/core/ui.js
Expand Up @@ -17,6 +17,10 @@ define([
function(shortcut, pubsubhub) {

function ariaDecorate(elem, ariaMap) {
if (!elem) {
debugger;
return;
}
Array
.from(ariaMap.entries())
.reduce(function(elem, nameValue) {
Expand All @@ -39,8 +43,8 @@ define([
"<div id='respec-ui' class='removeOnSave respec-hidden'></div>", document)
.appendTo($("body", document));

const $respecPill = $("<button id='respec-pill' disabled>ReSpec</button>")
.click(function(e) {
const $respecPill = $("<button id='respec-pill' disabled>ReSpec</button>");
$respecPill.click(function(e) {
e.stopPropagation();
const expand = this.getAttribute("aria-expanded") === "true" ? "false" : "true";
this.setAttribute("aria-expanded", expand);
Expand Down

0 comments on commit f02a044

Please sign in to comment.