Commit 7d320f7e by Qubad786 Committed by M. Rehan

remove unnecessary bookmark screen readers

parent eca90ddc
......@@ -5,9 +5,7 @@
return Backbone.View.extend({
errorMessage: gettext('An error has occurred. Please try again.'),
srAddBookmarkText: gettext('Click to add'),
bookmarkText: gettext('Bookmark this page'),
srRemoveBookmarkText: gettext('Click to remove'),
bookmarkedText: gettext('Bookmarked'),
events: {
......@@ -88,12 +86,10 @@
this.$el.addClass('bookmarked');
this.$el.attr('aria-pressed', 'true');
this.$el.find('.bookmark-text').text(this.bookmarkedText);
this.$el.find('.bookmark-sr').text(this.srRemoveBookmarkText);
} else {
this.$el.removeClass('bookmarked');
this.$el.attr('aria-pressed', 'false');
this.$el.find('.bookmark-text').text(this.bookmarkText);
this.$el.find('.bookmark-sr').text(this.srAddBookmarkText);
}
},
......
......@@ -6,7 +6,6 @@
<button class="btn bookmark-button"
aria-pressed="false"
data-bookmark-id="bilbo,usage_1">
<span class="sr bookmark-sr"></span>&nbsp;
<span class="bookmark-text">Bookmark this page</span>
</button>
</div>
......
......@@ -39,11 +39,9 @@ define(['backbone', 'jquery', 'underscore', 'edx-ui-toolkit/js/utils/spec-helper
if (bookmarked) {
expect(view.$el).toHaveAttr('aria-pressed', 'true');
expect(view.$el).toHaveClass('bookmarked');
expect(view.$el.find('.bookmark-sr').text()).toBe('Click to remove');
} else {
expect(view.$el).toHaveAttr('aria-pressed', 'false');
expect(view.$el).not.toHaveClass('bookmarked');
expect(view.$el.find('.bookmark-sr').text()).toBe('Click to add');
}
expect(view.$el.data('bookmarkId')).toBe('bilbo,usage_1');
};
......
......@@ -162,8 +162,4 @@ $bookmarked-icon: "\f02e"; // .fa-bookmark
}
.bookmark-sr {
@include margin-right($baseline / 4);
}
}
......@@ -5,7 +5,6 @@
<button class="btn btn-link bookmark-button ${"bookmarked" if is_bookmarked else ""}"
aria-pressed="${"true" if is_bookmarked else "false"}"
data-bookmark-id="${bookmark_id}">
<span class="sr bookmark-sr">${_("Click to remove") if is_bookmarked else _("Click to add")}</span>
<span class="bookmark-text">${_("Bookmarked") if is_bookmarked else _("Bookmark this page")}</span>
</button>
</div>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment