From 2fd60c6d2599d991c8d05ad101844ea840bc1528 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Thu, 1 Aug 2013 19:26:09 -0400 Subject: [PATCH] Select chosen stylesheet on load --- js/style-select.js | 11 ++++++----- 1 file 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( - $('') - .text(this.innerText.replace(/(^\[|\]$)/g, '')) - .val(i) - ); + var opt = $('') + .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++; });