Skip to content
This repository has been archived by the owner on Feb 27, 2019. It is now read-only.

Commit

Permalink
Bugfixes and more
Browse files Browse the repository at this point in the history
~ Changed every innerText to textContent to prevent empty strings in firefox
~ updated infofiles
~ restructured gruntfile

+added package-lock.json file to the repository
  • Loading branch information
Tanuel committed Jun 21, 2017
1 parent 2c96da9 commit 50b6a45
Show file tree
Hide file tree
Showing 8 changed files with 859 additions and 20 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/node_modules/
/nbproject/private/
/.sass-cache/
/package-lock.json
/bin/
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jsBanner:'TmDropdown v<%=pkg.version%>\n *(C) <%=pkg.author%> <%= grunt.template.today("yyyy") %>\n *https://tanuel.github.io/TmDropdown',
jsBanner:'TmDropdown v<%=pkg.version%>\n *(C) <%=pkg.author%> <%= grunt.template.today("yyyy") %>\n *<%=pkg.homepage%>',
dst: 'dist',
bin: 'bin',
projectName: 'TmDropdown',
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*Leightweight* JavaScript Library/Plugin for costum select dropdowns.
Also provides *optional* jQuery integration.

[**Read the documentation here!**](https://tanuel.github.io/TmDropdown)

Include **CSS** and **JS** on your website:

<link rel="stylesheet" href="css/TmDropdown.css">
Expand Down
12 changes: 6 additions & 6 deletions dist/js/TmDropdown.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*! TmDropdown v0.4.0
/*! TmDropdown v0.4.1
*(C) Daniel Schuster 2017
*https://tanuel.github.io/TmDropdown */
*https://tanuel.github.io/TmDropdown/ */
;(function (window,document) {
"use strict;"
/** ----- TmDropdown default configuration -----
Expand Down Expand Up @@ -324,9 +324,9 @@ class TmDropdown {
current.className = 'tmDropdown-current';
//if the select doesnt have any options, set different text
if (select.selectedIndex !== -1) {
current.innerText = select.options[select.selectedIndex].innerText;
current.textContent = select.options[select.selectedIndex].textContent;
} else {
current.innerText = this.getOption("emptyText");
current.textContent = this.getOption("emptyText");
wrapper.style.width = "auto";
}
current.addEventListener("click", this.toggle.bind(this));
Expand Down Expand Up @@ -361,7 +361,7 @@ class TmDropdown {
*/
_buildOption(option) {
var li = document.createElement("li");
li.innerText = option.innerText;
li.textContent = option.textContent;
var selected = option.selected ? ' tmDropdown-active' : '';
var disabled = option.disabled ? ' tmDropdown-disabled' : '';
li.className = 'tmDropdown-li' + selected + disabled;
Expand All @@ -384,7 +384,7 @@ class TmDropdown {
li.className = "tmDropdown-optgroup";
var label = document.createElement("div");
label.className = "tmDropdown-optgroup-label";
label.innerText = optgroup.label;
label.textContent = optgroup.label;
var ul = document.createElement("ul");
ul.className = "tmDropdown-optgroup-options";

Expand Down
12 changes: 6 additions & 6 deletions docs/js/TmDropdown.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*! TmDropdown v0.4.0
/*! TmDropdown v0.4.1
*(C) Daniel Schuster 2017
*https://tanuel.github.io/TmDropdown */
*https://tanuel.github.io/TmDropdown/ */
;(function (window,document) {
"use strict;"
/** ----- TmDropdown default configuration -----
Expand Down Expand Up @@ -324,9 +324,9 @@ class TmDropdown {
current.className = 'tmDropdown-current';
//if the select doesnt have any options, set different text
if (select.selectedIndex !== -1) {
current.innerText = select.options[select.selectedIndex].innerText;
current.textContent = select.options[select.selectedIndex].textContent;
} else {
current.innerText = this.getOption("emptyText");
current.textContent = this.getOption("emptyText");
wrapper.style.width = "auto";
}
current.addEventListener("click", this.toggle.bind(this));
Expand Down Expand Up @@ -361,7 +361,7 @@ class TmDropdown {
*/
_buildOption(option) {
var li = document.createElement("li");
li.innerText = option.innerText;
li.textContent = option.textContent;
var selected = option.selected ? ' tmDropdown-active' : '';
var disabled = option.disabled ? ' tmDropdown-disabled' : '';
li.className = 'tmDropdown-li' + selected + disabled;
Expand All @@ -384,7 +384,7 @@ class TmDropdown {
li.className = "tmDropdown-optgroup";
var label = document.createElement("div");
label.className = "tmDropdown-optgroup-label";
label.innerText = optgroup.label;
label.textContent = optgroup.label;
var ul = document.createElement("ul");
ul.className = "tmDropdown-optgroup-options";

Expand Down
Loading

0 comments on commit 50b6a45

Please sign in to comment.