Skip to content

Commit

Permalink
Merge pull request #18 from Mykola-Veriga/patch-1
Browse files Browse the repository at this point in the history
Accessibility: name for button and alt for image
  • Loading branch information
oizulain authored Jun 25, 2019
2 parents 6ebcd9b + a32233c commit 167448e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/jquery.ddslick.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
};

var closeListenerInitialized = false;
var ddSelectHtml = "<div class='dd-select'><input class='dd-selected-value' type='hidden' /><button type='button' class='dd-selected'></button><span class='dd-pointer dd-pointer-down'></span></div>";
var ddSelectHtml = "<div class='dd-select'><input class='dd-selected-value' type='hidden' /><button name='dd-selected-button' type='button' class='dd-selected'></button><span class='dd-pointer dd-pointer-down'></span></div>";
var ddOptionsHtml = "<ul class='dd-options'></ul>";

//CSS for ddSlick
Expand Down Expand Up @@ -371,7 +371,7 @@
//If set to display to full html, add html
if (settings.showSelectedHTML) {
var ddSelectedData = $("<div>");
if(selectedData.imageSrc) ddSelectedData.append($("<img>").addClass("dd-selected-image" + (settings.imagePosition === "right" ? " dd-image-right" : "")).attr("src", selectedData.imageSrc));
if(selectedData.imageSrc) ddSelectedData.append($("<img>").addClass("dd-selected-image" + (settings.imagePosition === "right" ? " dd-image-right" : "")).attr("src", selectedData.imageSrc).attr("alt", "dd-selected-image"));
if(selectedData.text) ddSelectedData.append($("<label>").addClass("dd-selected-text").text(selectedData.text));
if(selectedData.description) ddSelectedData.append($("<small>").addClass("dd-selected-description dd-desc" + (settings.truncateDescription ? " dd-selected-description-truncated" : "")).text(selectedData.description));
ddSelected.html(ddSelectedData.html());
Expand Down

0 comments on commit 167448e

Please sign in to comment.