From 217fdb1b9340c1f62c17fbb65549e7be75bd4bd1 Mon Sep 17 00:00:00 2001 From: Stephen James Date: Thu, 28 Aug 2014 23:20:34 -0400 Subject: [PATCH] default-dropdown-header: selectlist: make default have --- index.html | 26 ++++++++++++++++++++++++-- js/selectlist.js | 15 ++++++--------- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/index.html b/index.html index e4ab33ee8..7dd60429a 100644 --- a/index.html +++ b/index.html @@ -778,7 +778,7 @@

#Scheduler

- +
+ + +
+
diff --git a/js/selectlist.js b/js/selectlist.js index 267fe956b..dc52e2afb 100644 --- a/js/selectlist.js +++ b/js/selectlist.js @@ -163,16 +163,13 @@ }, setDefaultSelection: function() { - var selector = 'li[data-selected=true]:first'; - var item = this.$element.find(selector); - if(item.length === 0) { - // select first item - this.selectByIndex(0); - } - else { - // select by data-attribute - this.selectBySelector(selector); + var $item = this.$element.find('li[data-selected=true]').eq(0); + + if($item.length === 0) { + $item = this.$element.find('li').has('a').eq(0); } + + this.doSelect($item); }, enable: function() {