Skip to content

Fixed container.dataset for IE #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions dist/so-card-widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@ var out='<div class="so-card"><a href="'+(it.profile_url)+'" target="_blank" cla
return tmpl;})();
(function(document) {
var container = document.getElementById('so-card-widget'),
config = container.dataset,
userid = container.getAttribute('data-userid'),
theme = container.getAttribute('data-theme'),
request = new XMLHttpRequest(),
request_url = "//api.stackexchange.com/2.2/users/" +
config.userid + '/?site=stackoverflow',
userid + '/?site=stackoverflow',
widget_stylesheet_url = "//mudassir0909.github.io/stackoverflow-card/dist/1.0.0/so-card-widget.min.css",
logo_url = "//cdn.rawgit.com/mudassir0909/stackoverflow-card/master/assets/img/so-icon.png",
profile_url = '//stackoverflow.com/users/' + config.userid;
profile_url = '//stackoverflow.com/users/' + userid;

function render(user_info) {
var theme_class = "so-card-theme-" + (config.theme || 'default');
var theme_class = "so-card-theme-" + (theme || 'default');

container.className += theme_class;
container.innerHTML = window.so_tmpl['so-card-template']({
Expand All @@ -31,7 +32,7 @@ return tmpl;})();
}

// Inserting widget stylesheet
if (config.theme !== 'custom') {
if (theme !== 'custom') {
(function(document, tag_name) {
var existing_stylesheet_tags, last_stylesheet_tag,
widget_stylesheet_tag = document.createElement(tag_name);
Expand Down