diff options
| author | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-01 19:26:09 -0400 |
|---|---|---|
| committer | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-01 19:26:09 -0400 |
| commit | 2fd60c6d2599d991c8d05ad101844ea840bc1528 (patch) | |
| tree | b9e1e006239f014df375703d072729e3f2e89f72 /js | |
| parent | cf0a20a5645e1e82a48ad00f9381813af3b4e658 (diff) | |
Select chosen stylesheet on load
Diffstat (limited to 'js')
| -rw-r--r-- | js/style-select.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/js/style-select.js b/js/style-select.js index ac17c7ce..33c1308b 100644 --- a/js/style-select.js +++ b/js/style-select.js @@ -19,11 +19,12 @@ onready(function(){ var i = 1; stylesDiv.children().each(function() { - stylesSelect.append( - $('<option></option>') - .text(this.innerText.replace(/(^\[|\]$)/g, '')) - .val(i) - ); + var opt = $('<option></option>') + .text(this.innerText.replace(/(^\[|\]$)/g, '')) + .val(i); + if ($(this).hasClass('selected')) + opt.attr('selected', true); + stylesSelect.append(opt); $(this).attr('id', 'style-select-' + i); i++; }); |
